Cannot move an app to the SD card

五迷三道 提交于 2021-02-07 14:23:30

问题


I am not able to move my own application to the SD card.

My corresponding parts of manifest are as below (I am pasting also what permissions it needs).

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
    android:installLocation="preferExternal"
    android:label="@string/app_name" >

<uses-sdk
    android:minSdkVersion="6"
    android:targetSdkVersion="9" />

I believe I followed guidelines described here: http://developer.android.com/guide/topics/data/install-location.html (compatibility and pemissions). However, during installation (from SDK but also from Android Market) applications lands on internal storage, and I can't move it using "Manage Applications".


回答1:


try this...

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="preferExternal"
    package="your.package.name"
    android:versionCode="1"
    android:versionName="1.0" >
...
...



回答2:


You need to include android:installLocation="auto" in your <manifest> tag




回答3:


As per the Backwards Compatibility section of the App Install Location docs,

Existing applications that were built prior to API Level 8 will always install on the internal storage and cannot be moved to the external storage (even on devices with API Level 8).

However, you can still take advantage of the install location feature by setting your build target to API level 8 (or higher).

To do so, right click on your project, then go to Properties > Android. Select API level 8 (Android 2.2) or higher from the list.



来源:https://stackoverflow.com/questions/11723387/cannot-move-an-app-to-the-sd-card

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!