0

Possible Duplicate:
Android pre-filled DB

I want to use SQLite as a static data. By that I mean to preload it with data before application first start. This data is static = no inserts, deletes or updates. I just want to use full power of sql database queries and indexes. Because my SQLite database should have a lot a lot of data I don't want to upset users with long initial loading time.

Is there any way to do it (preloaded, predefined, preinserted database)?

Community
  • 1
  • 1
zmeda
  • 2,909
  • 9
  • 36
  • 56

1 Answers1

2

No, sadly this is not possible. A workaround is to copy the database over to the application data or to the SD card (if available) and load it from there, but IMHO this is an ugly solution.

Have you thought about using Java data structures for this data? It should be much faster to preload. If you do not want to use plain Java structures, I would recommend to use JSON or protobuf - whatever works best for you. :-)

mreichelt
  • 12,359
  • 6
  • 56
  • 70