【发布时间】:2011-09-27 14:25:55
【问题描述】:
我正在使用这个进行短信备份
public void smsbackup() throws IOException
{
InputStream in = new FileInputStream("/data/data/com.android.providers.telephony/databases/mmssms.db");
File dir = new File("/mnt/sdcard/bcfile");
dir.mkdirs();
OutputStream output = new FileOutputStream("/data/data/com.android.app/files/");
byte[] buffer = new byte[1024];
int length;
while ((length = in.read(buffer))>0)
{
output.write(buffer, 0, length);
}
output.flush();
output.close();
in.close();
}
它会抛出像permission denied 这样的异常我不知道我会给予什么许可。有人告诉我吗?提前致谢。
【问题讨论】:
-
哈哈!您已经使用了哪些权限?
-
你应该查看你的异常日志,它会显示你缺少什么权限。
-
另外,如果您在将来从 LogCat 发布 Stacktrace 真的很有帮助
-
@Sherif :这些是我的应用程序的所有权限列表 - pastebin.com/QyXAN5Cp
标签: android sms backup permission-denied