I've got a content question: I am writing an application that shows a town code. It's lots of data (~8MB of text). I first got it inside a sqlite3 db file. I can not place the data online for that application to retrieve. I have to ship it using the application.

In reading through how you can ship this monster, I discovered 3 approaches:

  1. ship a txt file with the instructions to produce tables, place data and make indexes, after which walk the file and run every command throughout onCreate.
  2. ship b .db file in assets (or must i use raw) and copy the file to /data/data/...
  3. ship an accumulation of files (txt, not db) and open them as I have to show the information
    Neither of those approaches appear to operate very well. I believe 3 is the greatest option, but I am unsure, and that i would need to create all of the files, etc. In addition, the files could be uncompressed, and I am unsure in the event that would finish up taking more room compared to .db file.

The questions:

  1. what is a good pattern to operate a predicament like that one?
  2. how large is 'reasonable' when speaking about how big a sqlite3 db inside a phone?
  3. Basically open a 8MB db file and it open as the application is running, shall we be held a hog?


From the three options suggested I believe #2 is the best choice. It's the same as #one in the ultimate result and can alllow for a significantly simpler deployment. (You don't need to try to produce the db quickly.) It will likewise considerably more performant than option #3 because indexes is going to be cerated and handled through the db. If you opt for #3 and then try to match the performance of #2 you'll have to make your own indexes anyway that will call for a number of complex coding as well as your memory usage will finish up just like large, otherwise bigger, than option #2.

  1. Unsure that designs matter within this situation. It's all about controlling a sizable dataset.
  2. Reasonable is really a relative term when speaking about how big an application. If it's really helpful towards the consumer a bigger application is going to be reasonable.
  3. "Hog" is another relative term per the reasoning above. Whether it's helpful, the consumer will endure the "hog".

Another option is to place the database behind an internet service and merely ship the applying that accesses it. Besides creating a significantly more compact memory footprint around the device it might also permit much simpler updates towards the data. E.g. you wouldn't need to push updates whenever the information transformed.

Also try this: Excuses have you employed research to ascertain if this dataset can be obtained free of charge using a public/government web service? Take a look here.

  1. You might ship a zipped version of the database after which extract it towards the sd-card. Some applications make use of two programs Body for that application and something for that data. By doing this the interior space for storage is not hogged by data. The "data-application" just extracts the information towards the sd-card and may be uninstalled after completing its task.

  2. You will find lots of programs which use large databases. I believe you ought to be fine.

  3. Have no idea