Bera
Bera

Reputation: 693

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)

Upvotes: 0

Views: 2280

Answers (3)

user3560789
user3560789

Reputation: 1

Beginning with API Level 8, you can allow your application to be installed on the external storage (for example, the device's SD card). This is an optional feature you can declare for your application with the android:installLocation manifest attribute. If you do not declare this attribute, your application will be installed on the internal storage only and it cannot be moved to the external storage.

To allow the system to install your application on the external storage, modify your manifest file to include the android:installLocation attribute in the element, with a value of either "preferExternal" or "auto". For example:

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

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="19" />

<application>
...
</application>

Upvotes: 0

Lalit Poptani
Lalit Poptani

Reputation: 67296

I think you should check this blog which clearly mentions that this feature is not suporrt below API level 8.

Upvotes: 1

user370305
user370305

Reputation: 109257

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

Upvotes: 3

Related Questions