padam thapa
padam thapa

Reputation: 1477

Moving to SD card

I know move to sd card feature is available from android 2.2 I want to know is there way to detect in my program if device supports move to sd card feature, if its supported it can be moved else if not supported than nothing will happen(will be in phone memory)

My main issue is my app is supporting all devices from 1.6 to above, and i can't use

android:installLocation="auto"

because its not recognized for below version 2.2 . So do i have to do checking and enabling programmatically and if so how ? I hope you understand my problem.

Thanks.

Upvotes: 4

Views: 1934

Answers (4)

3c71
3c71

Reputation: 4511

While the programmatic features are available from 2.2 and above, the actual move to sd feature is not actually possible on every phones, even when there is an internal or even external SD card!

In ICS and JB now, the OS can decide to move apps TO SD by itself, while users don't have any option to move apps manually to/from SD card!

This behavior has been tested on Galaxy Nexus, Galaxy S3, Galaxy Tab 2, Transformer and Iconia A500 both with ICS and JB! None of them had move-so-sd button!

So it would still be interesting to find out if user can move apps to SD at runtime.

Upvotes: 2

havexz
havexz

Reputation: 9590

Well you can use this flag. Just try to compile against api level 8 and above.

Make sure the android:minSdkVersion is set correctly to 4.

The older platform will ignore android:installLocation and newer platforms will honor that.

The compilation just for recognizing the new flag.

Move to sd card is available from 2.2 and above so you don't have to explicitly check for it.

Upvotes: 0

Kartik Domadiya
Kartik Domadiya

Reputation: 29968

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 <manifest> 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.

This is what Android's Backward Compatibility Says.

Also refer Applications That Should NOT Install on External Storage and Applications That Should Install on External Storage

Upvotes: 8

Abhinava
Abhinava

Reputation: 1030

This is a OS specific feature not device specific. You should be checking for OS version. In case the sd card is not available in the device, it will not show move option automatically.

Upvotes: 0

Related Questions