创建数据库Android的许可 [英] Android permission of creating database

查看:112
本文介绍了创建数据库Android的许可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我在android系统中创建SQLite数据库的一些问题。

Hi I have some problems in creating the sqlite database in android.

一切正常在模拟器上,我可以创建数据库。但它不实际的机器上工作。当我试图调试我的手机上的应用程序,它只是无法创建数据库。

Everything is ok on the emulator, I can create the database. But it doesn't work on the actually machine. When I tried to debug the application on my phone, it just failed to create the database.

因此​​,谁能告诉我发生了什么事?是否有任何特殊的权限,我需要在manifest文件中添加?我已经试过ACCESS_CHECKIN_PROPERTIES或WRITE_EXTERNAL_STORAG​​E,但仍无法得到数据库。

So can anyone tell my what happened? Is there any special permission I need to add in the Manifest file? I've tried ACCESS_CHECKIN_PROPERTIES or WRITE_EXTERNAL_STORAGE, but still cannot get the database.

顺便说一句,就是自定义数据库只能存储在SD卡,但根目录?

By the way, is the custom database can only be stored in the sd card but the root directory?

非常感谢你!

推荐答案

如果没有错误的任何反馈,这是不可能告诉你什么是错在你的code。不过,我可以告诉你,你做的不可以需要 ACCESS_CHECKIN_PROPERTIES 使用自己的数据库。你不应该需要 WRITE_EXTERNAL_STORAG​​E 或者,除非您要访问的SD卡。

Without any feedback in the error, it is impossible to tell you what's wrong in your code. Nevertheless, I can tell you that you do not need ACCESS_CHECKIN_PROPERTIES for using your own database. You should not need WRITE_EXTERNAL_STORAGE either unless you are trying to access the sdcard.

该数据库默认保存在您的应用程序文件夹的子文件夹在内部存储,即:

The databases are stored by default in a subfolder of your app folder in the internal storage, i.e.:

/data/data/YOUR_APP/databases/YOUR_DATABASAE.db

如果你这样做,一个物理设备上它必须虽然扎根。

If you do that on a physical device it has to be rooted though.

这篇关于创建数据库Android的许可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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