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 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 files names to be puimobile_orders.js and puimobile_orders.json
More details and sample code can be found in our Sample projects:
There are two offline mobile examples available. Both examples use the same Javascript program and example files.
The only difference between the two examples is that one uses a Profound.js web service and the other uses a Profoudn UI Universal Display program for the web service
Universal Display version: https://github.com/ProfoundLogic/offline-mobile-universal-display
Profound.js version: https://github.com/ProfoundLogic/offline-mobile-sample