Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should I define my Android app as not movable to SD card (installLocation=internalOnly)?

In which cases I should forbid the users to move my app to the SD Card (by setting installLocation to internalOnly)?

I'm asking to know this for a few apps, so please don't ask about my app. I want to know this in general for any app.

like image 248
Diego Avatar asked Jul 01 '11 10:07

Diego


People also ask

What happens if we move Apps to SD card?

All files of the app are moved to sd card except one little pointer in the internal storage that tells the system where the app is located. (imagine if you format your SD card manually, then your phone won't know app has dissapeared) but if you unmount it phone won allow you to access.

Why do some Apps not Move to SD card?

Reason 1.Developers of Android apps need to explicitly make their apps available to move to the SD card using the “android:installLocation” attribute in the <manifest> element of their app. If they don't, the option to “Move to SD card” is grayed out.

How do I force an app to Move to SD card?

Go to Settings > Apps and tap the app you want to move to your SD card. Next, under the Storage section, tap Move to SD Card. The button will be grayed out while the app moves, so don't interfere until it's done. If there's no Move to SD Card option, the app cannot be moved.

What is Android installLocation?

android:installLocation="auto" — specifies that the phone's configuration will determine the installation location. Generally, your app will be installed to internal storage if sufficient space is available.


3 Answers

The requirements is quite well described in the documentation. Primarily, if you're running anything in the background that must execute at all times, like a service, or if you provide widgets, you can run from external storage. But as soon as the user unmount the external storage, the process in which these things run will be terminated.

like image 86
Peter Lillevold Avatar answered Oct 20 '22 21:10

Peter Lillevold


If you define android:installLocation="auto" inside the manifest inside the AndroidManifest.xml file then and then(yes it must) it will allows user to move app to SD card option.

There are 3 values you can set to android:installLocation attribute:

android:installLocation="auto"
android:installLocation="internalOnly"
android:installLocation="preferExternal"
like image 8
Paresh Mayani Avatar answered Oct 20 '22 21:10

Paresh Mayani


The Android documentation has a pretty comprehensive list about this - http://developer.android.com/guide/appendix/install-location.html

The key point is that when the user starts using the device as a USB drive, Android will kill everything related to your app. So, anything which has to run in the background to function properly or has to use the external storage should not be put on the SD card.

like image 2
Abhinav Avatar answered Oct 20 '22 22:10

Abhinav