HomeGuidesRecipesAPI
HomeGuidesAPILog In

Mobile Data Sources (Offline Apps)

Using data sources with SmartIQ Offline Apps

There are various ways of setting up a data source for the offline (iOS/Android/Windows) client. Each option has advantages and disadvantages.

Standard online data source

This is the default option when creating a data object. Data will only be available while the application has a connection to Produce. This has the advantage of always fetching the latest data, however it hampered by having to perform a web service call to Produce every time it’s required. Page transitions will be slower as they cannot be displayed until the data source call has completed.
If you load a form while online, select a row and then save in progress, the selected row will be encrypted and written to the answer file. This allows a user to continue while offline and is similar to the ‘Use Answer File Data’ option.
Pros:
Always have latest data
Cons:
Slower data fetch

Mobile Cache

This option is available for compatible data sources on the data object page. Mobile cache downloads every row of the data source for offline use. As every row is downloaded (regardless of filters), performance degrades per row of data downloaded. Data filtering is also slower on a mobile cache data object as it uses its own per row filtering system (SQL is not available).

Mobile cache is controlled by three additional time span options.

Refresh Rate: If this time span has elapsed, the data will be downloaded again from Produce. Setting this to 00:00:00 will refresh the data for every synchronisation. When Refresh Rate has elapsed and the app is synchronised, Expiry Warning and Expiry are reset.
Expiry warning: If a form is launched and this time span has elapsed, a warning message is displayed under the data source. This informs the user that they have been offline for longer than the specified setting and their data might be out of date. A warning message will not be displayed if this is set to 00:00:00.
Expiry: Once this time span has elapsed, the mobile cache data is no longer valid and will not be used. The user must synchronise with Produce before they can continue. Data will not expire if this is set to 00:00:00.
Pros:
Once a form has launched, data is accessed faster. Useful for simple data sources.
Cons:
Slower filtering
Degrades with large data sources
Downloading lots of data
Limited memory on phones. If your data source is large, the operating system could terminate the app.

Use Answer File Data

Downloads the selected row for offline use. Must be used in conjunction with the publish option ‘Allow offline launch’. This will stop SmartIQ fetching data and is useful for handling large data sources. The typical use case for using this option is when a component of a workflow requires an offline step. When this has been configured, the selected row of the data source will be encrypted and written to the answer file. The user will not be able to change this selection while in offline mode.

Example: A nurse is visiting a client in a remote area. In the initial work flow step, the nurse selects the client from the data source (which has 10,000 patients) and transitions the workflow to the next step. The nurse then synchronises the app and a task appears on the device. When the nurse opens this task, the patient will appear in the data source question. The nurse will not be able to select another patient while offline.
Pros:
Can use very large data sources offline
Fast
Cons:
Cannot change value while offline

Offline data option preference:

  1. Use answer file data (and data has been written/saved to the answer file)
  2. Mobile Cache (If it exists)
  3. Online (And the user is online)
  4. Cannot fetch data