Application

Enterprise Browser 3.6

Overview

The Application class is used for accessing or setting application level configuration settings.

Enabling the API

There are two methods of enabling the Application API:

  • Include all ebapi modules
  • Include only the required API modules

For either of these methods, you'll need to include files from the /Enterprise Browser/JavaScript Files/Enterprise Browser directory on the computer that you installed the Enterprise Browser.

Include all JS API modules

To include all JS APIs, copy the ebapi-modules.js file to a location accessible by the app's files and include a reference to the JavaScript file in the app's HTML. For instance, to include the modules file in the app's index.html, copy the file to the same directory as that index.html and add the following line to the HTML's HEAD section:


<script type="text/javascript" charset="utf-8" src="ebapi-modules.js"></script>

Note: that the pathing for this file is relative to the current page.

This will define the EB class within the page. Any page you need to use the modules will need to have the .js file included in this fashion.

Include only the required modules

To include single APIs, you must first include the ebapi.js in your HTML as well as the API file you want to use. For instance, to use the Application API, I would add the following code to my HTML file(s), assuming the API files have been copied to the same directory as the HTML.


<script type="text/javascript" charset="utf-8" src="ebapi.js"></script>
<script type="text/javascript" charset="utf-8" src="eb.application.js"></script>

The ebapi.js file is necessary for all single API inclusions.

Methods

databaseFilePath(STRING partitionName)

Path to the ORM database file by partition name. Please note that this function does not create a database file. This function only generates the file path based on the application path and partition name.

Parameters

  • partitionName : STRING

    Partition name.

  • callback : CallBackHandler

Callback

Async Callback Returning Parameters: STRING

    Returns

    Synchronous Return:

    • STRING : Full path to the database file for given partition.

    Platforms

    • Android
    • Windows Mobile
    • Windows CE

    Method Access:

    • Class Method: This method can only be accessed via the API class object.
      • EB.Application.databaseFilePath(STRING partitionName)

    expandDatabaseBlobFilePath(STRING relativePath)

    Generates the absolute path to database blob file. Please note that this function does not the create database file. This function only generates the file path based on application path and partition name.

    Parameters

    • relativePath : STRING

      Relative path to the blob file, as it is stored in the database.

    • callback : CallBackHandler

    Callback

    Async Callback Returning Parameters: STRING

      Returns

      Synchronous Return:

      • STRING : Full path to the database blob.

      Platforms

      • Android
      • Windows Mobile
      • Windows CE

      Method Access:

      • Class Method: This method can only be accessed via the API class object.
        • EB.Application.expandDatabaseBlobFilePath(STRING relativePath)

      minimize()

      Minimize or move the application to background.

      Parameters

      • callback : CallBackHandler

      Returns

      Synchronous Return:

      • Void

      Platforms

      • Windows Mobile
      • Windows CE

      Method Access:

      • Class Method: This method can only be accessed via the API class object.
        • EB.Application.minimize()

      modelFolderPath(STRING name)

      Folder of the model by name.

      Parameters

      • name : STRING

        Model name.

      • callback : CallBackHandler

      Callback

      Async Callback Returning Parameters: STRING

        Returns

        Synchronous Return:

        • STRING

        Platforms

        • Android
        • Windows Mobile
        • Windows CE

        Method Access:

        • Class Method: This method can only be accessed via the API class object.
          • EB.Application.modelFolderPath(STRING name)

        quit()

        Quit the application. Note: Quitting the application while license screen is displayed results in a delay.

        Parameters

        • callback : CallBackHandler

        Returns

        Synchronous Return:

        • Void

        Platforms

        • Android
        • Windows Mobile
        • Windows CE

        Method Access:

        • Class Method: This method can only be accessed via the API class object.
          • EB.Application.quit()

        relativeDatabaseBlobFilePath(STRING absolutePath)

        Generates the relative path to database blob file. Please note that this function does not create a database file. This function only generates the file path based on the application path and partition name.

        Parameters

        • absolutePath : STRING

          Absolute path to database blob file.

        • callback : CallBackHandler

        Callback

        Async Callback Returning Parameters: STRING

          Returns

          Synchronous Return:

          • STRING

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          Method Access:

          • Class Method: This method can only be accessed via the API class object.
            • EB.Application.relativeDatabaseBlobFilePath(STRING absolutePath)

          restore()

          Restores the application to be in the foreground.

          Parameters

          • callback : CallBackHandler

          Returns

          Synchronous Return:

          • Void

          Platforms

          • Android 10 and later
          • Windows Mobile
          • Windows CE

          Method Access:

          • Class Method: This method can only be accessed via the API class object.
            • EB.Application.restore()

          setApplicationNotify()

          This method allows your application to register for application specific events like application activation/deactivation, UI creation/destruction as well as others. Check the Callback section for details.

          Parameters

          • callback : CallBackHandler

          Callback

          Async Callback Returning Parameters: HASH

            • applicationEvent : STRING

              Possible Values :

              Constant: EB.Application.APP_EVENT_ACTIVATED
              String:Activated
              The application has been activated.
              Constant: EB.Application.APP_EVENT_DEACTIVATED
              String:Deactivated
              The application has been deactivated.
              Constant: EB.Application.APP_EVENT_UIDESTROYED
              String:UIDestroyed
              This event is triggered when the application is closing and the UI has been cleared.
              Constant: EB.Application.APP_EVENT_SCREEN_OFF
              String:ScreenOff
              Device screen was turned off when power button was pressed or due to idle timeout. On Android the application is not deactivated.Not supported on Windows CE. Platforms: Android, WM
              Constant: EB.Application.APP_EVENT_SCREEN_ON
              String:ScreenOn
              Device screen was turned on and unlocked.Not supported on Windows CE. Platforms: Android, WM
            • eventData : HASH

              This will only contain values for the APP_EVENT_CONFIGCONFLICT event. This event may be triggered after an application was upgraded. If your rhoconfig.txt file contains custom properties that are different then what is being provided in the application upgrade package. By default local values are kept in place but you may overwrite configuration with new values and any other steps required for your application upgrade. eventData will be a hash. It will look like {"conflicting key" : ["new value","old value"].. }

          Returns

          Synchronous Return:

          • Void

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          Method Access:

          • Class Method: This method can only be accessed via the API class object.
            • EB.Application.setApplicationNotify()

          Properties

          appName

          Type

          STRING Read Only

          Description

          Application name.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.appName

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          badLinkURI

          Type

          STRING Read Only

          Description

          Bad link URI to navigate in browser. This is defined in config.xml: Navigation\BadLinkURI.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.badLinkURI

          Platforms

          • Windows Mobile(WebKit)

          bundleFolder

          Type

          STRING Read Only

          Description

          Path to the Enterprise Browser folder on the device.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.bundleFolder

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          configPath

          Type

          STRING Read Only

          Description

          Path to the configuration file.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.configPath

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          databaseBlobFolder

          Type

          STRING Read Only

          Description

          Path to folder where the database blob files are stored. Blobs are usually images or binary files. In the ORM Model you would specify that the attribute is of type blob Ex. When capturing an image, the actual file is saved in the databaseBlobFolder.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.databaseBlobFolder

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          defaultNativeMenu

          Type

          ARRAY Read Only

          Description

          Native Menu items.

          Params

        • Object : HASH

          Same values as nativeMenu.

        • Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.defaultNativeMenu

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          invalidSecurityTokenStartPath

          Type

          STRING Read Only

          Description

          Page to navigate to in case of check of SecurityToken failed. Can be set in rhoconfig.txt: invalid_security_token_start_path; This file is located in the installation folder of the EnetrpriseBrowser application installed on the device.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.invalidSecurityTokenStartPath

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          modelsManifestPath

          Type

          STRING Read Only

          Description

          Path to file with the model list.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.modelsManifestPath

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          nativeMenu

          Type

          ARRAY

          Description

          Native Menu items.

          Params

        • Object : HASH

          • label : STRING

            Visible label.

          • action : STRING

            URL to page which will be loaded. Or it can be a JavaScript method to call: 'javascript: methodOnTab();'. Or path to html page to load.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.nativeMenu

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          publicFolder

          Type

          STRING Read Only

          Description

          Path to the application's public folder.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.publicFolder

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          securityTokenNotPassed

          Type

          BOOLEAN Read Only

          Description

          Indicates if the security token check was failed. Security token can be passed as command line parameter '-security_token=token_value' to the application. If security token check failed : if this page exist then application navigate to it, otherwise application will exit.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.securityTokenNotPassed

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          settingsPageURI

          Type

          STRING

          Description

          Settings page URI. Will be used when Options menu or toolbar item is chosen by user.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.settingsPageURI

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          splash

          Type

          STRING Read Only

          Description

          Splash screen image display options. This a string with several parameters divided by ';': delay=5;center;hcenter;vcenter;vzoom;hzoom;zoom.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.splash

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          startURI

          Type

          STRING

          Description

          Startup page for your application.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.startURI

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          title

          Type

          STRING

          Description

          Define Window caption text. If missed - caption from page used. Not supported on Windows CE devices.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.title

          Platforms

          • Windows Mobile

          userFolder

          Type

          STRING Read Only

          Description

          Path to folder where the application can write files and create subfolders.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.userFolder

          Platforms

          • Android
          • Windows Mobile
          • Windows CE

          version

          Type

          STRING Read Only

          Description

          Version of Enterprise Browser.

          Access

          • Class: This property can only be accessed via the API class object.
            • EB.Application.version

          Platforms

          • Android
          • Windows Mobile
          • Windows CE