Skip to main content

Analysis

Offline in Mobile

This chapter describes offline functionalities in SAMO Mobile. Although offline mode is very powerful and useful, it is not intended to be used as a primary mode of operation. The main purpose of offline mode is to allow users to continue working in situations where network connectivity is temporarily unavailable or unreliable.

When the application is in offline mode, users can perform various operations such as viewing, creating, editing, and deleting features. All changes made while offline are stored locally on the device. Once the device regains network connectivity, the application allows to synchronize the local changes with the server.

There always be some limitations when working in offline mode. Some operations that are processed on the server side may not be fully available offline (business scripts, derived values, etc...).

Common offline features:

  • Application start

    • When the application is running in online mode and the connection is lost, it is switched to offline automatically and it can be further used as described below

      • It can be configured what does “connection is lost” mean – if it is no signal or only low signal (ONLY ANDROID). See offlineSignalLimit parameter in Parameters chapter in samo-mobile.xml.
    • When the connection is established again, it is switched to online mode automatically and it is possible to continue working with the application

      • This scenario is used if the user has not made any changes to the data while offline
    • If the user makes any change in the data in the offline mode, he must switch to the online mode manually (using the icon in the application)

      • This means, that even when the connection to the internet is available, the application will not switch to online mode automatically and the user must determine when to start synchronizing changes

      • Before synchronizing, the user can review the changes made while offline and choose to synchronize them with the server or discard them

      • Everything is signalized to the user in the application - whether there is an internet connection or not, whether the application is in online or offline mode, whether there are offline changes that were not synchronized or not

    • Without internet connection, application can be restarted in offline mode only in case of “basic” authentization (username/password). Other authentization methods (OAuth, SSO, etc.) require internet connection to authenticate the user

    • If the application was terminated in offline mode and the user starts it again and there is an internet connection available, the first action the user must perform is to synchronize the changes

  • Changes synchronization

    • All changes made by the user in the application in offline mode are saved to the device in the changes queue

    • To switch to online mode, the changes queue must first be sent to the application server (or discarded)

    • Changes are sent one by one, chronologically

    • If some particular change is not applied successfully on the application server, the user has following options:

      • Retry saving the change

      • Skip particular change and continue syncing

      • End synchronization and remain offline (changes, that were successfully synchronized, are removed from the changes queue, those that were not processed, remain in the queue)

      • Data changes available in offline mode:

        • Creating new features

        • Editing existing features

        • Deleting features

        • Creating new related features

        • Creating and deleting attachments

        • Creating, editing and deleting protocols

        • Business workflow actions (if there is some business logic behind – it will be processed in the moment of synchronization – so it will not be visible in client application in offline mode) ONLY ANDROID

  • Workflow (ONLY ANDROID)

    • Available states and transitions for offline must be configured in offline workflow configuration in samo-mobile.xml

    • Application is able to display all current states of features in offline mode (even those, that are not available for offline)

    • Application is able to change states in offline (only transitions that are configured for offline)

    • Keep in mind, that if there is some business logic behind some particular transition, that this logic is not performed immediately in offline mode, but at the time of changes synchronization

      • It is possible to configure to open some particular form when performing some transition - see special usages in light forms definition.
  • Data caching

    • There are two types of caching mechanism:

      • Browse screens data caching

      • Map data caching

    • Browse screens caching (ONLY ANDROID)

      • Immediately after the user logs in (online), the application stores all the browse screens related data needed for offline use to the device automatically

        • Application launch may be slowed down because of this
      • It must be specified via screens configuration which screens (features) and which related features should be cached

      • Needed codelist are cached automatically

      • Needed metadata parts and codelists, resources, etc. are cached automatically

      • Existing attachments are not downloaded to device cache at all

    • Maps caching

      • There is no automatic map layer caching mechanism

      • User must start map layer data caching manually

        • Layer list to cache must be specified (by user or by configuration)

        • Map range must be specified by user

SAMO Assignments

TODO: ...