The database structure will be as follows:
city_id city_name
1 Hyderabad
2 pune
5 mumbai......
I want to add the data to my app's database from the .db file which is in the assets folder of the project.
The database structure will be as follows:
city_id city_name
1 Hyderabad
2 pune
5 mumbai......
I want to add the data to my app's database from the .db file which is in the assets folder of the project.
There is a good answer in here Android external database in assets folder.
Just to improve the performance of your app, I would suggest that you make the db file in your computer and then import the .db file in the assets folder. (not the .txt file directly)
ContentValues values = new ContentValues();
for(int i = 0; i<=5; i++) {
values.put(city_id, cityId[i]);
values.put(city_name, cityName[i]);
db.insert(TABLE_NAME, null, values);
}