Skip to content

Showing how to integrate Zebra Datawedge into a Webview

License

Notifications You must be signed in to change notification settings

ZebraDevs/DW-WEBVIEW

Repository files navigation

DATAWEGDE INTEGRATION INTO A WEBVIEW-BASED APP

  • Successfully tested on A8.1, A13, A14 Webview 117, 121 and 122

  • Two variants are now supported and each creates its dedicated DW profile image

    image

  • Screenshots

    image

Code annotations about DW Intents and Profiles

  • The onCreate method

    protected void onCreate(Bundle savedInstanceState) {

    defines at the same time

    • a new DW profile

    image

    • and the related Intent Receiver

    image

    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))