0

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)

1
  • -1 for not using the search function Commented Nov 19, 2011 at 11:18

3 Answers 3

3

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

Sign up to request clarification or add additional context in comments.

3 Comments

No resource identifier found for attribute installLocation... when I try to write in 1.5 version manifestfile
it Beginning with API Level 8. So no chance.
in market there are lot of apps that is under API level 8 and they are allowed to install on SD card? how they do? (I have 2.3.3 version device)
1

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

1 Comment

thanks but can you show me any example? I can't understand it
0

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> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.