Offline Mobile Sample



The Profound UI mobile application supports an offline type of connection.

The Offline Mode enables an app to gather information while disconnected and then sync the data back to the server when a connection is available.

There are a number of differences between using the Profound Mobile client in standard vs offline mode as described below:

  • A JavaScript program must be created to run on the app.

  • The JavaScript program must use a Rich Display screen saved as a JSON file.

  • A "Sync" web service is needed to sync the collected data back to the server.

  • JavaScript and JSON files must be stored in the IFS at the Profound UI instance folders userdata/js folder

    • For a standard instance installation the path is /www/profoundui/htdocs/profoundui/userdata/js/

  • The JavaScript program may have any functionality you wish but must include the following methods:

    • run(displayData, connection, callback) - Called when connection name is tapped and should include the application code.

    • sync(connection, callback) - Called when the Sync icon is tapped and should contain the code to contact the server web service and send and/or receive data.

    • isSyncNeeded() - Should contain code to determine if there is data that needs to be synced back to the server.

Program naming:

The default names for the JavaScript and JSON files are puimobile_default.js and puimobile_default.json.

To create multiple programs, you will need to use the Parameter field which then becomes part of the file names.

For example: If you enter Orders in the Parameter field during connection setup, you would need the file names to be puimobile_orders.js and puimobile_orders.json.

Examples:

More details and sample code can be found in our Sample project:



Profound.js version: https://github.com/ProfoundLogic/offline-mobile-sample