Search code examples
javaandroidupdating

How to update Android application's local data sources?


I have an application which pulls its data from a local XML file. However, the data changes overtime and I am looking for a way to update it without updating the whole application.

My main goal is to create an update method which would connect to Internet if such connection is possible and update the application so that the next time the application is launched without Internet access it would display the latest version of data.

Since Android application files are in read only state I need some sort of workaround. I am thinking of two possible approaches. First one is to download an extra file and work with it, and the second is to utilize a SQLite database.

So my questions are:

  • Is it possible to create application with updatable information?
  • If so what is the right approach to accomplish this?

Solution

  • I think you should use a "Fridge".

    When first launch, take default data and store it in sd card or internal storage, and replace these data when an update occurs.