What is the best strategy for synchronizing data offline / online? [closed]

1

I'm able to get an application for external sales, it basically will order and if you do not have an internet connection, it will synchronize when you have it. Good ..

How to make this application professional?

Example: Using services, broadcastReceivers, webservice, this I have in mind to use, can someone help me what an application has to have to be considered good, professional?

    
asked by anonymous 01.08.2014 / 13:43

1 answer

0

Some points to consider:

  • To allow offline operation (external sales) your application should contain all products in a local database (example: in SQLite )
  • You need to sync whenever possible, depending on how often these products change ... if they are updated monthly, then you can use a AlarmManager to make this update periodically, considering cases, for example, if the phone is turned off at the time of the trigger, on powering the device to check and 'update' if connection.
  • You can also start from a strategy where you only synchronize when the device is connected to Wifi, you can check the connection types with ConnectivityManager
  • To download the data, you choose the format if it is in a JSON service or a batch of zip data. The choice will not stop being less or more professional.
  • I believe you will need to upload your completed requests while offline, then you will surely need a webservice available on the server to receive this data. From this requirement, you need a webserver running to receive this data and process it.
  • Using BroadcastReceivers will make it necessary to detect connection type change by For example, the Service will be needed when the information is being processed as 'download' from the data from the server and upload the data to the server.

        
    01.08.2014 / 14:36