Data sync between web application & mobile app

Data sync between web application & mobile app

by Sushma R -
Number of replies: 2

Hi Team,

I have few questions in my mind, 

  • How will the branded app connects to the database
  • what is the frequency data gets synced in both web application & Moodle app?
  • Will mobile app also have local db in place for the data storage?

Thanks in advance.

Average of ratings: -
In reply to Sushma R

Re: Data sync between web application & mobile app

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers

Hi,

the Moodle app communicates with the server using WebServices. So for example when the user opens the "My courses" page, we call the appropriate WebServices to retrieve that info.

The app has a cache system (using a local database) to avoid calling the server too often. So for example if a user opens a certain course several times in a short time, the first time the app will perform a request to the server to obtain the latest data but the following requests will use the data that is already stored in the device. This system is the one that allows the app to work in offline. The "valid time" of the information depends of the WebService (whether the data retrieved can change often or not), and it can go from 7 minutes to 18 hours. In general there is no synchronization system to keep this information up to date, it will be updated the next time the user opens the page in online and the data is no longer "valid".

When a user tries to create/edit/delete something in offline and the app allows it, we store the data in a local database to be sent when the user is connected. There are several factors that can impact how often we try to send the offline data to the server, the app usually waits 5 - 15 minutes between retries (e.g. if the server is down).

So yes, the app has a local db to store the data (it uses sqlite).

Cheers,

Dani

In reply to Dani Palou

Re: Data sync between web application & mobile app

by Sushma R -
Thank for the details info