Android模拟器的SD卡权限 [英] Android emulator sdcard permissions

查看:194
本文介绍了Android模拟器的SD卡权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Eclipse和试图让Android模拟器让我写SD卡。

I'm using eclipse and trying to get the android emulator to let me write to the sdcard.

在我的手机上安装应用程序会提示接受所需的权限...和程序工作。当我尝试使用模拟器来测试应用程序,我没有得到提示,并用拒绝的权限程序结果。

when I install the app on my phone it prompts to accept the permission required... and the program works. When I try using the emulator to test the app I don't get prompted and using the program results in permission denied.

我试过重新我的AVD ......并有SD卡大小为4GB。
很显然,我必须在AndroidManifest.xml的使用许可行...
在这里,它是:

I've tried recreating my avd... and have the sdcard size set to 4Gb. Obviously I have the uses permission line in the AndroidManifest.xml... and here it is:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="j**.B********.App"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application android:icon="@drawable/icon" android:label="@string/app_name" android:permission="android.permission.WRITE_EXTERNAL_STORAGE">
        <activity android:name=".NotesActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>

所以,我怎么模拟器给我写信给SD卡的权限?我所做的作品在手机上...那么,为什么不能在模拟器?

So how do I get the emulator to give me the permission to write to the sdcard? What I've done works on the phone... so why not in the emulator?

刚才在模拟器开发者工具终端我试图导航到SD卡...权限被拒绝。

Just now in the dev tools terminal in the emulator I tried to navigate to the sdcard... permission denied.

看他们是d ---------

Looking at permissions in eclipse DDMS perspective and they are d---------

编辑:我得到它的工作。

I got it to work.

我不得不手动开始从AVD管理模拟器。让当你打运行Eclipse启动模拟器似乎短路的东西。

I had to manually start the emulator from the avd manager. Letting eclipse start the emulator when you hit run seems to short circuit something.

推荐答案

打开AVD管理器,选择合适的仿真器,并选择修改从右侧面板

Open the AVD manager, select the appropriate emulator, and choose Edit from right panel.

然后在硬件选项,你会看到许多属性,现在,请点击按钮,并选择 SD卡的支持,点击确定

Then on the hardware option, you will see many properties, now, click the New button, and choose SD card support, click Ok.

现在您可以在模拟器中使用的Micro-SD卡。

Now you can use your SD-Card within the emulator.

这篇关于Android模拟器的SD卡权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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