原料资源的Android文件路径 [英] raw Resources Android filepath
本文介绍了原料资源的Android文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有数据库放在原始的文件夹,我需要加载数据库路径安装APK是什么时候?在哪儿?在/数据/数据/程序包/文件?我没有看到呢?
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?
我的工作与extisting SQLite数据库。
I work with extisting sqlite database.
推荐答案
它没有路径:这是一种资源,所以你需要的是这样使用 getResources()来引用
。
It has no path: It is a resource, so you need to reference is as such using getResources()
.
您应该在第一次运行时,将其复制到 /data/data/YOUR_APP_FOLDER/databases/YOUR_DB.db
You should, at the first run, copy it to the /data/data/YOUR_APP_FOLDER/databases/YOUR_DB.db
您可以按照本教程:的http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
这篇关于原料资源的Android文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文