如何手动插入数据库到Android项目? [英] How do I manually insert a database into a Android project?

查看:113
本文介绍了如何手动插入数据库到Android项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该数据库文件被的Dalvik 确定,当我通过Dalvik的插入调试监控服务器(DDMS),但是当我的数据库添加到项目入资产它甚至不上传到设备中(如我可以通过DDMS看到)。如何解决呢?

The database file is identified by Dalvik when I insert it via the Dalvik Debug Monitor Server (DDMS), but when I add the database to the project assest it doesn't even upload to the device (as I can see through the DDMS). How to fix it?

推荐答案

添加 sqlite的分贝到资产文件夹不会使它供您使用。
你的数据库应该被复制到 /数据/数据​​/ YOUR_PACKAGE /数据库/ 在第一次运行。

Adding a sqlite db to the assets folder will not make it available for you to use it. Your db should be copied to /data/data/YOUR_PACKAGE/databases/ on the first run.

此链接

这篇关于如何手动插入数据库到Android项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆