Offline Sync in Mobile Applications – Kiruthika P

Implementation of Lazy Loading – Ranjith V
April 17, 2018
Real-time data synchronization – Kiruthika P
April 17, 2018

Offline Sync in Mobile Applications – Kiruthika P

We all absolutely detest a situation where we can’t use a certain application because of bad network connectivity or no connectivity. At this point, we’ve wondered how great it would be if these applications would work offline. Entailing this thought process, I started work on building an app that works both online and offline. I’ve been successful in making many functionalities available offline. Read on to know how.

What is Offline sync?

Offline data sync is one of the most useful features developed in mobile apps till date. The essence- when your app is in the offline mode, you can create and modify data, which will be saved to a local database and when the app is online again, it synchronises local changes with the server.

What are the benefits of offline sync?

  • End user can create and modify the data without network access
  • User can create the invoice from anywhere despite network hitches
  • There is no loss of data or updates when the network fails which saves time & efforts
  • Increases the responsiveness of the app by storing the data in the local database

How does it work?

The mobile app I have developed is mainly for creating sales invoices. In this scenario, the salesperson needs to enter the leads using the app whenever he gets an enquiry. Now, consider a situation where he has limited internet access, slow network or some network issue. The application requires a good internet connection to update the data, the absence of which will result in the loss of data. Here, I applied the concept of offline sync. This is how it works:

  • Store the invoice data in the local database with some reference value. For example, OFF001. You can create ‘n’ number of records offline.
  • Take a count of the records that need to be synchronised with the server. Using that, you’ll have a definite idea about the number of records stored in the local database.
  • Once you have access to the internet, the data gets synchronised with the server automatically.
  • Clear the local database when the data sync is done, to acquire more space.
  • If you check the offline sync data count, it will be 0. This sync count is useful to check whether all the invoice details have been synchronised with the server.

Now you have the server updated without any data loss. Using the reference value, you can identify the invoices which were created offline.

However, this procedure has a few limitations. Though we can store data in the local database, we need to keep in mind that there is a storage limit which isn’t too large so we can’t store all the data in the local database. Therefore, it works only for certain scenarios that require you to store a small amount of data. In the current development stage, it is not possible to store the entire application’s data.

We all absolutely detest a situation where we can’t use a certain application because of bad network connectivity or no connectivity. At this point, we’ve wondered how great it would be if these applications would work offline. Entailing this thought process, I started work on building an app that works both online and offline. I’ve been successful in making many functionalities available offline. Read on to know how.

Leave a Reply

Your email address will not be published. Required fields are marked *