Enabling “Move to SD Card” Installation on Android
It’s quite simple.
Open your AndroidManifest.xml
and add this attribute in the <manifest>
element.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
...>
There are two values you can use: auto
and preferExternal
. Use auto
to let the system decide which one to install your application to, whether on the phone storage or external storage such as SD card. Another value, preferExternal
, will give the system priority to save your application on the external storage first. If the system can’t install your application on the external storage because of one or more things (full, unmounted, etc.), the system will then decide to store your application to the phone storage.
For more details about this, you can visit the official Android documentation here: App Install Location.