Answer the question
In order to leave comments, you need to log in
How to connect your database to an Android application?
Hello.
There is a lot of information on how to create your own database in the code itself, but there is no working information on connecting an existing database.
First I want to learn how to work with a clean database, and then start working with ORMLite&
Thank you
Answer the question
In order to leave comments, you need to log in
write the same SQLiteOpenHelper but instead of creating a database, check if there is already a database file;
if not, then copy the finished database from assets (or from somewhere else, for example from the network) to /data/data/YOUR_PACKAGE/databases/DATABASE_NAME
update:
File datbasefile=context.getDatabasePath(DATABASE_NAME);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question