Altova MobileTogether Designer

Offline Usage

Home Prev Top Next

Your MobileTogether solution, whether accessed using the MobileTogether Client app on a client device or an app store app, can be designed to enable a user to work offline (that is, with no active network or Internet connection). Data can be synchronized with one or more databases on the MobileTogether Server when the user reconnects to the server.

 

This topic: (i) lists the main settings that enable offline work; and (ii) describes how each of these settings affect offline work and can be used in a design.

 

The sub-topics of this section contain descriptions of different ways in which users can work offline and synchronize subsequently, when they come online.

 

Steps to enable offline work

To enable the user to work offline, use one or more of the following settings according to what your design needs are.

 

In the Project Settings, set Server Access to On demand. This ensures that the server will be contacted (for downloading or uploading data) only when the solution initiates such an action.

In the context menu of page source trees, set both Load Data and Save Data to Not Automatically.

Use the $PERSISTENT page source to store data on the client.

If you want to download data to the client, use a Reload action.

Use a Save action or DB Execute action to upload data to the server.

 

The steps above are general indicators. For a better understanding, see the discussion of these settings below.

 

For a description of some scenarios of offline use, see the examples in the sub-topics of this section.

 

Settings that enable offline work

The following settings determine when and how data is transferred between client and server. These settings effectively configure offline usage and data synchronization. Set their values according to the needs of your solution.

 

Project settings

The Server Access setting is a key setting for determining offline use. It takes one of three values: (i) Always, (ii) On Demand, (iii) Never. The main difference between Always and On Demand is that in the case of Always data transfer between server and client occurs continually, whereas in the case of On Demand data transfers occur only when explicitly specified via an action. One consequence of using On Demand  is that data trees are not automatically updated at solution start. This difference can be seen in the example solutions 02-DisplayRecords.mtd and 03-DisplayOnDemand.mtd, where Server Access has been set, respectively, to Always and On Demand.

 

Load data

The Load Data setting is available on the root node of page sources. It is not available on $PERSISTENT page sources. Load Data takes one of three values: (i) On first use, (ii) On every page, (iii) Not automatically. The value of the setting can be assigned when the page source is created; it can be changed subsequently via the context menu of the source's root node. If you want to work offline and to ensure that the client does not automatically connect to the server (on solution start or when a new page loads), then set Load Data to Not Automatically. Given this setting, the server will not be contacted for automatic data loading, and the client can stay offline. To load data from the server, you would have to implement an explicit action to load data, for example, a Load File action, Reload action, or a DB Execute action.

 

Save data

The Save Data setting is available on the root node of any page source that is linked to a data file or a DB. It is not available on $PERSISTENT page sources. Save Data takes one of four values: (i) On every page leave, (ii) On any solution finish, (iii) On last submit, (iv) Not automatically. The value of the setting can be assigned when the page source is created, and it can be changed subsequently via the context menu of the source's root node. If you want to work offline and ensure that the client does not automatically connect to the server (on a page leave, a solution finish, or a last submit), then set Save Data to Not Automatically. In this case, the server will not be contacted for automatic data saving, and the client can stay offline. To save data to the server, you would have to implement an action such as the Save action.

 

 

By setting Server Access to On Demand and Load Data and Save Data to Not Automatically, you effectively set the client device to be offline.

 

 

© 2018-2024 Altova GmbH