https://github.com/zebradevs/dw-webview
Showing how to integrate Zebra Datawedge into a Webview
https://github.com/zebradevs/dw-webview
Last synced: 4 months ago
JSON representation
Showing how to integrate Zebra Datawedge into a Webview
- Host: GitHub
- URL: https://github.com/zebradevs/dw-webview
- Owner: ZebraDevs
- License: mit
- Created: 2024-03-06T11:29:27.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-04T14:39:20.000Z (over 1 year ago)
- Last Synced: 2025-02-10T08:51:23.162Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 231 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DATAWEGDE INTEGRATION INTO A WEBVIEW-BASED APP
## v1.6+ INFORMATION
Since Feb.2025 created profiles are no longer associated with this app => use the "SWITCH PRO" button to enable a profile when running the app
## Release notes
- Successfully tested on A8.1, A13, A14 Webview 117, 121 and 122
- Two variants are now supported and each creates its dedicated DW profile


- Screenshots

## Code annotations about DW Intents and Profiles
- The onCreate method
https://github.com/ZebraDevs/DW-WEBVIEW/blob/2541876d11670e7616d7a9e584a0f8991ae4867a/app/src/main/java/com/zebra/dw_webview/HDLauncherActivity.java#L47
defines at the same time
- a new DW profile

- and the related Intent Receiver

for other purposes the received barcode data is then passed to a webview and displayed as HTML text.
- DW profiles have the following features
- each profile is associated to the respective app variant
`bundleApp1.putString("PACKAGE_NAME", appName)`
`val activityName = arrayOf("*")`
`bundleApp1.putStringArray("ACTIVITY_LIST", activityName)`
- the IntentOutput plugin is configured to send an intent named after the applicationID (app's package name)
`bParams.putString("intent_action", appName)`
- a prefix (1# or 2#) is added to the reading output to differentiate the profile that generated it
`bundleAllPluginsConfig.add(dwSetPrefixPostfix(context))`
- the KeystrokeOutput plugin is switched off
`bundleAllPluginsConfig.add(dwSwitchOffKeystrokeOutput(context))`
## HIDE OVERLAY WINDOWS

To test this feature:
- ensure the DW profile uses INTERNAL_CAMERA as barcode input source
- keep switch 5 off
- press 4 to activate a DW profile
- press 1 or side scan buttons to trigger scanning. Note that the camera preview is visible
- then set 5
- again scan with 1 or side buttons - appreciate that the scanning completes, but no preview is available
- long press 2 - the system camera preview is brought up. it is not affected by the setHideOverlayWindows API