English 中文(简体)
如何在开发蜂窝电话时进入数据库? [复制]
原标题:How to access the database when developing on Android phone? [duplicate]

在我正在电话上开发时,我难以访问数据库。 每当我执行

<编码>cd/data/com.mycompck/databases

编号:<0> 我收到:opendir败诉,被拒收>

sqlite3 查阅:<代码>sqlite3:被拒绝的许可”

我做了什么错误?

是否有某些应用能够帮助我从人的角度看待内容解决者的价值和/或结构数据库?

最佳回答
问题回答

查阅我的以下答复:。 为什么在使用粘合器时我无法获得数据夹?

Starting from API level 8 (Android 2.2), if you build the application as debuggable, you can use the shell run-as command to run a command or executable as a specific user/application or just switch to the UID of your application so you can access its data directory.

因此,基本上,你需要做一个装饰的建筑(automatically)。 每当你从安的演播室发射申请,除非你要求释放大楼,否则就会运行以下指挥系统:

run-as com.mycompck
cd /data/data/com.mycompck/databases
ls
sqlite3 ./yourdatabase.db

但是,注意到<代码>sqlite3 binary 在许多电话中并不存在。 因此,或许需要将其下载到其他地方(例如,从位于http://shortfuse.org/的Super OneClick档案中下载),但放在SD卡上,使之可以执行(这不过是一小小bit,例如:

run-as com.mycompck
cd /data/data/com.mycompck/
cat /sdcard/sqlite3 >./sqlite3
chmod 744 ./sqlite3
./sqlite3 ./databases/yourdatabase.db

你必须成为查阅任何数据库档案的基础。 因此,你要么能够根植于你的电话上(了解谷歌的信息),要么仅仅从主人那里打碎数据库(给你根本的通道)。

!!





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签