Search code examples
androidandroid-manifest

android app on SD card


how to allow app to install on SD card?

android:installLocation="" 

allow but I need to work it also on 2.0 version (this works only on 8 sdk and up)


Solution

  • To allow installation on external storage and remain compatible with versions lower than API Level 8:

    1. Include the android:installLocation attribute with a value of "auto" or "preferExternal" in the element.
    2. Leave your android:minSdkVersion attribute as is (something less than "8") and be certain that your application code uses only APIs compatible with that level.
    3. In order to compile your application, change your build target to API Level 8. This is necessary because older Android libraries don't understand the android:installLocation attribute and will not compile your application when it's present.

    When your application is installed on a device with an API Level lower than 8, the android:installLocation attribute is ignored and the application is installed on the internal storage.

    For more look at App Install Location