Sample Apps

Enterprise Browser 3.7

Overview

Sample apps are intended to demonstrate basic functionality of common Enterprise Browser APIs and show how to integrate API code into an HTML page. Use of the sample apps requires a basic understanding of Enterprise Browser and its Config.xml runtime configuration file. See the Config Editor Utility guide for more information. To learn EB basics, see the About page. Also see the EB Feature Demo app.

Also see the EB API Feature Demo.

Notes

  • The ebapi-modules.js file is required for Enterprise Browser 1.x APIs to function on Android and Windows Mobile/CE devices.
  • APIs for EB 1.x are sometimes referred to as the "Common" APIs.
  • The elements.js file is required for Pocket Browser and RhoElements APIs to function on Android devices.
  • The Adaptive Printer Driver (APD) is supported on Android and Windows Mobile/CE devices.
  • Printing an image requires a file called image.png to be located on the device.
  • Printing images on a Windows Mobile/CE device requires the sample code to be modified.
  • See the Accessing the Code section (below) for more information about placement of API module files.

IMPORTANT: Apps are fully functional only when launched using Enterprise Browser; their layouts can be viewed through this browser by clicking their nearby links.


Using Sample Apps

Tapping on a sample app (from a desktop browser) using one of the links below will display the app's layout and controls but its API will be inoperative. To see how the API works, it must be opened from within Enterprise Browser. This can be done either by using EB to navigate to the page's URL, or setting the URL as EB's start page (through the <StartPage> parameter in the Config.xml file). The latter process is explained below.

To activate a sample app in Enterprise Browser:

  1. Identify the sample app and API on the platform of interest.
  2. Right-click on its link and select "Copy Link Address."
  3. Paste the link into the <StartPage> parameter of the Config.xml file.
  4. Push the updated config.xml file to the device.
  5. Launch Enterprise Browser and test the sample app.

Audio Speech Recognition App

Demonstrates how EB Audio Speech Recognition (ASR) APIs can be used for conversion of Speech-to-Text, enabling developers to convert audio spoken into an app to text.

For Enterprise Browser


Barcode App

Demonstrates how to use the Barcode or Scanner API to enumerate all the scanning devices currently attached to the device and to scan a barcode and fetch the decoded data via callback. Enterprise Browser uses the Barcode API. The corresponding API for Pocket Browser and RhoElements is called Scanner.

For Enterprise Browser

For Pocket Browser

For RhoElements


Battery App

Demonstrates how to use the Battery API to retrieve battery status and show/hide the battery icon.

For Enterprise Browser

For Pocket Browser

For RhoElements


Camera App

Demonstrates how to use the Camera or Imager API to take a picture.

For Enterprise Browser

For Pocket Browser

For RhoElements


Database App

Demonstrates use of the low-level Database API to access a local SQLite database.

For Enterprise Browser


Display Detection App

Demonstrates how to use the setUserAgent property and the getConfigurationChangeNotification method of the WebView API to set the WebView User Agent and be notified if the user agent changes.

This sample app can be helpful for organizations using Zebra Workstation Connect (ZWC). It employs a registered callback that, when fired, queries the display size and invokes the desktop user agent if the display width is greater than the height, allowing an EB app to adjust its size when moved to the ZWC screen.

For Enterprise Browser


EKB Intent App

Demonstrates how an EB intent API can be used to query for custom layouts in Enterprise Keyboard and change a custom layout's functionality.

For Enterprise Browser


EzNFC App

Demonstrates how to use the EzNFC API to enable/disable the NFC Adapter and read NFC Tags. This API is available for only Android devices.

For Enterprise Browser


Intent App

Demonstrates how to use the Intent API to send an Intent and how to receive an Intent via Broadcast receiver. This sample code is intended for Android devices only but will operate on Windows Mobile/CE devices with modification.

For Enterprise Browser


KeyCapture App

Demonstrates how to use the KeyCapture API to capture and remap keys.

For Enterprise Browser

For Pocket Browser

Remap for Pocket Browser

For RhoElements


Printer App

Demonstrates how to use the EB 1.x Printer API to find a printer and output text or images via Bluetooth, USB and Wi-Fi on Enterprise Browser for Android only. The APD API works to print a text string with or without a label with EB, PB and RE on Android devices and with EB on Windows Mobile/CE devices. Printing an image from a Windows Mobile/CE device requires modifications to this sample code.

Bluetooth For Enterprise Browser

USB For Enterprise Browser

Wi-Fi For Enterprise Browser

Adaptive Printer Driver (APD)

Printing an image from an Android device requires a file called image.png to be stored in /sdcard/Pictures/image.png on the device.


Signal App

Demonstrates how to use the Signal or SignalIndicators API to retrieve the signal status and to show/hide the signal icon. Enterprise Browser uses the SignalIndicators API. The corresponding API for Pocket Browser and RhoElements is called Signal.

For Enterprise Browser

For Pocket Browser

For RhoElements


RFID App

Demonstrates how to use the RFID API to retrieve RFID data and use it in an EB app.

EB 3.7 (and later) supports new methods and preFilters on devices running Android 11 and later.

API update required. Download "elements.js" file and place in folder with sample app.

For Enterprise Browser


Signature App

Demonstrates how to use the Signature or SignatureCapture API to capture, show, hide and clear a signature. Enterprise Browser uses the Signature API. The corresponding API for Pocket Browser and RhoElements is called SignatureCapture.

For Enterprise Browser

For Pocket Browser

For RhoElements


Text to Speech App

Demonstrates how Enterprise Browser's Text-to-Speech (TTS) API can be used to convert text to speech or audio in applications.

For Enterprise Browser


Accessing the Code

To view or use the source code contained in a sample app, simply view it through a desktop browser and expose and/or save its source code using the steps below. Alternatively, download EB_SampleApps.zip, which includes all sample apps shown here, a web page with links to each, and the JavaScript API modules required to make them work.

To view the source code of an individual sample app:

1. Using a desktop browser, click the link for the sample app and API on the platform of interest.

2. Depending on the browser, right-click and select View Page Source or use the browser's View or Tools menu to find the corresponding command to expose the source: Chrome and Firefox offer a "View Page Source" right-click option.

3. View and/or copy and save the desired source code as needed:
In Firefox, select Tools -> Web Developer -> Page Source.

JavaScript API Files

Enterprise Browser APIs are contained in one of two JavaScript files, which must of present and accessible by any app page that calls them. The Enterprise Browser installation by default adds a C:/EnterpriseBrowser/JavaScriptFiles/ directory to the host machine, inside of which are two additional directories that contain the API files:

  • /EnterpriseBrowser/ - contains the Enterprise Browser JavaScript API file:
    • ebapi-modules.js - includes all EB.module APIs
  • /BackwardCompatibility/ - contains legacy PocketBrowser and RhoElements 2.x APIs:
    • elements.js - for supporting RhoElements 2.x and PocketBrowser 2.x/3.x applications

If Enterprise Browser APIs are used, these API files umust be present on the device and referenced within the HTML of any EB page that uses them. See the API Usage Guide and individual API pages for further details.


Related Guides