How to connect to your database from Android app?


A lot of information about how to create your database in the code, but no information on connecting existing database.

First I want to learn how to work with a clean database, and then start working with ORMLite&

Thank you
August 19th 19 at 23:09
1 answer
August 19th 19 at 23:11
write everything the same but instead of SQLiteOpenHelper to create the database, check whether there is already a database file
if not then copy the finished dB from assets (or from somewhere else, such as a network) to /data/data/YOUR_PACKAGE/databases/DATABASE_NAME
File datbasefile=context.getDatabasePath(DATABASE_NAME);
It would be good to indicate how you can obtain this way, and that in fact sehardcore. - Trystan.Hammes commented on August 19th 19 at 23:14
: you are right ) - Sophie_Green commented on August 19th 19 at 23:17

Find more questions by tags Android