I have an Android application which requires big database(2 GB) to work. The DB need to be copied in SD card or internal storage manually. Unfortunately, this is one DB file(sqlite)[Not a recommended way though]. The data need to be updated after an interval of time. Currently, the process is manually copying the DB file.
I want to create a scheme in which whole data need to be updated over the air(OTA) using the internet. The first thing that I should do is split huge DB files into smaller files. The approaches I thought of are these:
- Copy DB to server, write a service which checks the version of DB on client and server. If DB needs to be updated, then go through each table and insert/update/delete the data from the client.
- Zip(reduces the size by 70%) the delta part of DB and download it to the client. Write a service in client to update original DB using delta part.
Both the approaches have disadvantages. For example, if connection got disconnected in between whole thing need to be restarted.
What are the best ways by which I can do data update in Android? Is there anything in Android like BITS in C# framework which resumes download in case of failure?
0 comments:
Post a Comment