Opening a database in SQLite instead of creating it in Android Studio

1

Hello, I would like your help if there is a possibility to open a .db database (instead of creating the file) by android studio using sqlite.

I already created a .db data file with the data and played inside the device folder (data / data ... etc), the database will only serve for query, I imagine it to be in the OnCreate method of the SQLiteOpenHelper class that I can open the bank, but I have no idea how.

    
asked by anonymous 17.04.2017 / 20:50

1 answer

0

Natively you can not send an already populated .db file. I already researched this. You have a few options:

1) Use a library that does this (I found some but never used it)

2) Create the necessary inserts during the creation of the bank, if not a lot.

3) Download the data from some server over the internet in the first run of the application and popular the base.

    
08.05.2017 / 19:48