Sync Methods - Mobile

To be used offline, the EarthRanger Mobile app must sync resources from the web platform and save them in a local database on the device.

These are some of the different methods to sync content: 

Login

How do you sync?

When you log in with a user and password on the initial screen. 

  • If the user used to log in is different from the current one in the DB the local database will be deleted to start a new sync of the resources.

What is synced?

  • User Accounts
    • User Tracked By Subjects
  • Event Categories
  • Event Types
  • Patrol Types
  • Subjects

 

   

 

 

Once the app completes the process described above, a local database is created on the device. The EarthRanger app will then query this database to display event categories, event types, and patrols that the user or profile has permission to view.

This database will be the source of truth for the mobile app to know what data to display. If a change was made in the admin for the app to see this change it needs to sync. Example:

  • The name of an event category was changed
  • A new profile was added 
  • The permits of a user were changed
  • A new event type was created
  • A new patrol type was created 
  • The schema of an event type was modified

You can sync the app in the following ways:

  • Tap Sync in the status view
  • Close and Reopen the app (Splash screen)
  • Log out and log in with a new user (Note that this will delete all data)

Sync in the status view

How do you sync?

On the status view, you will find a Sync button on the top left that you can manually tap. 

What is synced?

  • Check resources and sync when needed
    • The app needs a stable network connection
    • The app will communicate with the web platform and ask if there were changes for:
      • Event Types
      • Event Categories
      • Event Patrols
      • Subjects
    • If there are changes the Earthranger mobile app will start the process of syncing by deleting the previous data in the DB and creating a new table
      • The sync button will gray out while this process completes 
    • Once the sync is complete the change made in admin should be available in the mobile app
  • Try and upload pending sync data
    • Events
    • Patrols
    • Tracking

Example:

I'm currently logged in as a user who has access to an event category called Monitoring.

 

That category has an event type called Human Wildlife Coexistence and Human Wildlife Coexistence(old)

In the admin I have deleted the event type:

Human Wildlife Coexistence(old) as I want to start using the Human Human Wildlife Coexistence in its place.

I don't see the event on the web.

For the event type to no longer display in the app we need to sync. 

 

So we navigate to the status view 

  • Make sure we have a good network connection
  • Tap sync 
  • Wait for the sync button to stop being grey out 
    • Depending on how many event types you have and the speed of connectivity
  • Navigate to the event category
  • The event Human Wildlife Coexistence(old) should no longer be available in the app

 

Splash Screen

How do you sync?

When you close the app and open it again when having an stable network connection the app will search for platform changed, the splash screen is shown with a loader. 

What is synced?

  • Check resources and sync when needed
    • The app needs a stable network connection
    • The app will communicate with the web platform and ask if there were changes for:
      • Event Types
      • Event Categories
      • Event Patrols
      • Subjects
    • If there are changes the Earthranger mobile app will start the process of syncing by deleting the previous data in the DB and creating a new table
      • The splash screen and the loader will remain open until this process is completed
    • Once the sync is complete the app will redirect to the map view 
    • The change made in admin should be available in the mobile app

Example:

User has access to the following categories:

  • Security
  • Ecology
  • Monitoring
  • Logistics
  • Marine
  • SMART Reports
  • WildAid
  • Manufacturing
  • Fauna

 

We remove all permits to categories

except for Monitoring

For the new permits in the event categories to display the app needs to sync.

 

  • Make sure we have a good network connection
  • Close the app 
  • Open the app
  • Wait for the splash screen to no longer display
    • Depending on how many event types you have and the speed of connectivity
  • Navigate to the reports view
  • Verify now the only event we have access to is monitoring

 

Login as a different user

How do you sync?

When you log out and log in as a different user that is not present in the local database, the database will delete and populate again with new data. 

What is synced?

  • All data is sync 
    • The app needs a stable network connection
    • Because the DB is deleted all resources will sync again, no matter if there was a change detected or not
      • Accounts users
      • Event Types
      • Event Categories
      • Event Patrols
      • Subjects

 

 

EarthRanger 2.6.7

 

 

 

 

 

Was this article helpful?