12.01.2011 21:05, androiddevelopers пишет:

Can i have the database preloaded, that is as aprt of my APk rather than me populating/creating on start of the activity. just like we have for icons or some files we can add as part of the drawable or in raw folder.

Yes, you can create your database anywhere using SQLite tools, and package it with your application (assets / raw).

The first the app is run, open the packaged database as a stream, and copy it into a file where your application has read/write access.

This can be the memory card or the path returned by Context.getDatabasePath(). If it's the latter, you'll then be able to use SQLiteOpenHelper to open the database.

--

Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to