Open Source iOS & Android App for Conferences and Events

    How Android app updates data

    How the app updates data? Mechanics of data update in mobile application.

    Internet is available

    Application checks for updates with a timestamp parameter.

    The checkUpdates call returns list of IDs.

    • If IDs list is not empty, application continues downloading data by each id and save it to database.
      • If all requests were successfully finished. the new timestamp will be saved for future use.
      • Each activity or fragment that could be updated on runtime will receive callback to load new data from database.
    • If IDs list is empty application will display data from database

    Internet is not available and no timestamp is saved

    App will display appropriate dialog and after clicking on “OK” app will simply close.

    For more details see class

    Internet is not available and timestamp is saved

    In this case check for updates call will not be performed, but because of timestamp is already saved, that mean that application already has data saved into database, so application will work in offline mode.

    While user close and restore app from background, activity on which user stopped app will perform check for updates request and if there will be some updates, they will be saved into database. As soon as all requests will be finished, UpdatesManager will notify each registered on update observer activity to load new data from database.