在Android手机上开发时如何访问数据库? [英] How to access the database when developing on Android phone?

查看:381
本文介绍了在Android手机上开发时如何访问数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在电话上开发时遇到了无法访问数据库的问题。每当我执行

I am having trouble accessing the database while I am developing on the phone. Whenever I execute

cd /data/data/com.mycompck/databases

然后运行 ls 我获得:opendir失败,权限被拒绝

或者当我输入 sqlite3 时,我得到:sqlite3:permission denied

Or whenever I type in sqlite3 I get: "sqlite3: permission denied"

我做错了什么?

是否有一些应用程序可以帮助我获得内容解析器值和/或SQLite数据库的人物视图?

Are there some applications that can help me getting a human view of content resolvers values and/or SQLite databases?

推荐答案

要回答问题的第一部分,请查看此答案。基本上,你的手机需要root权限,你需要以root模式运行adb(使用adb root)。

To answer the first part of your question, check out this answer. Basically, your phone needs to have root access, and you need to run adb in root mode (using "adb root").

至于第二部分,我使用 SQLite数据库浏览器查看我的SQLite dbs(虽然这只有当数据库在我的计算机上;不要知道任何设备上的浏览器)。我不知道有什么办法得到人们对内容解析器的看法。

As for the second part, I use SQLite Database Browser to view my SQLite dbs (though that's only when the db is on my computer; don't know of any on-device browsers). I don't know of any way to get a human view of content resolvers.

这篇关于在Android手机上开发时如何访问数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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