Ragunath Jawahar
Ragunath Jawahar

Reputation: 19723

Packaging SQLite DB with my application

I have created a SQLite database on my PC. I have imported it into my assets folder in the project directory. How do I access it from my Android application?

Upvotes: 5

Views: 775

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006614

Copy it into your database directory (getDatabasePath()) using Java I/O. At that point, you can use it like a normal database. It is impossible to use it from within the assets themselves.

Upvotes: 7

Related Questions