开发者

how to add xxx.db file into my project in android

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 curren开发者_运维知识库t position of the dp file once the app is inside the emulator . should i insert the db into the manifest or somehing else ? thanku


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜