开发者

How to store data when there is no connection and synchronize when connection is available

Im actually developing an android application that can connect to MYSQL database on web query it and get latest records. The p开发者_C百科roblem is how to do when there is no connection.. I mean that an employee with an android device would record an order from the customer office but unfortunately there is no connection..How to proceed in such case? How can we store the order locally and synchronise once the connection is available... My problem is the method.. Thanks


I would be solving this problem in following way:

  1. Always save save/write data to SQLite tables (it would be good if SQLite tables structure would be the same as MySQL ones)
  2. Check in background Thread connection availability
  3. As soon as you get connection - copy all data from SQLite to MySQL


Maybe this is interesting for you to watch. Virgil Dobjanschi explains in detail what barmaley suggests.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜