Skip to content Skip to sidebar Skip to footer

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

Solution 1:

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

Solution 2:

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.

Solution 3:

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.

Solution 4:

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.

Post a Comment for "Moving To Sd Card"