I have database placed开发者_如何转开发 in raw folder and i need to load the database path when the apk is installed? Where it is? in /data/data/package_name/FILE ? I dont see it?
I work with extisting sqlite database.
It has no path: It is a resource, so you need to reference is as such using getResources()
.
You should, at the first run, copy it to the /data/data/YOUR_APP_FOLDER/databases/YOUR_DB.db
You can follow this tutorial: http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
The files in the raw
folder are packed in the application's APK file. To open one of these files, use getResources().openRawResource(int id)
.
精彩评论