0

I'm creating a simple Android App, it will be a map with a number of points marked on it. These points will sometimes change, based on an XML file hosted on the internet.

To reduce the initial load time my intention is to distribute a serialized List of these points with the application that can be updated in the future.

At first my intention was to distribute this serialized file as an 'asset'. This way I could just generate the file and drop it in to 'assets'. However, this does not work because (from what I can see) it is not possible for me to overwrite these assets.

The second option was to use the internal storage, however (from what I can see) I can't distribute this file as 'internal storage'.

Is my only option to distribute my serialized List as an asset and then on the initial load copy it to the internal storage? The files only going to be around 50kb but it seems unnecessary to have 2 copies of the same file (1 of which will eventually become outdated) as part of the same application.

Andy Smith
  • 3,308
  • 4
  • 26
  • 34
  • The "copy" that exists as an asset will be compressed and remain within your APK. – mah Jul 17 '11 at 16:11

1 Answers1

0

How about always first checking the internal storage and if your data does not exist there read the 'asset' version.

Then you will have a syncronization job that will download the updated file (when available/updated) and put it in internal storage. But yes I guess you will be stuck with always having the original file there.

Kristian
  • 6,443
  • 6
  • 27
  • 29
  • Yeah - this is what I went for. It's not the end of the world to include 30kb of data that my become redundant in the future – Andy Smith Sep 28 '11 at 19:35