views:

29

answers:

1

i have xxx.db (SQLite file) where i want to add him to my android app in my android app under src i open new directory where i add "test.db"

then in my app what should i write in order to get the db ?

String myPath = "com.countryCityGame/databases/test.db";
SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);

i am sure mypath is spelled wrong ' what is the current position of the dp file once the app is inside the emulator . should i insert the db into the manifest or somehing else ? thanku

A: 

All databases that stored on phone not on SDCard are located in /data/data/com.PackageName/databases/test.db

See this tutorial for using your own database in Android

Orsol