Beginning with API Level 8, you can allow your application to be installed on the external storage (for example, the dev Ice ' s SD card). This is a optional feature you can declare for your application with the
android:installLocationManifest attribute. If you do
notDeclare this attribute, your application'll be installed on the internal storage only and it cannot is moved to the Exte rnal storage.
To allow the system to install your application on the external storage, modify your manifest file to include the android:installLocation att Ribute in the <manifest> element, with a value of either "" preferExternal or " auto ". For example:
<manifest xmlns:android= "http://schemas.android.com/apk/res/android" android:installlocation= " Preferexternal "... >
If you declare ' preferExternal ", you request the your application is installed on the external storage, and the system does not gu Arantee that your application would be a installed on the external storage. If the external storage is full, the system would install it on the internal storage. The user can also move your application between the locations.
If you declare " auto ", you indicate this your application may be installed on the external storage, but you don ' t has a Preference of install location. The system would decide where to install your application based on several factors. The user can also move your application between the locations.
When your application are installed on the external storage:
- There is no effect on the application performance so long as the external storage are mounted on the device.
.apkthe file is saved on the external storage, but all private user data, databases, optimized .dex files, and extracted Native code is saved on the internal device memory.
- The unique container in which your application is stored are encrypted with a randomly generated key so can be decrypted Only by the device, that originally installed it. Thus, an application installed on a SD card works for only one device.
- The user can move your application to the internal storage through the system settings.
Pick the key and say something about this article. The main core of this technical document is that, starting with Android API level 8, Android app developers can programmatically set the location of the app installation in their app: Install an external/externally extended memory card (such as an extended SD card inserted by the user on the device). This feature is implemented by simply setting the property value in Android manifest: android:installLocation . If the developer does not set this value, then the Android system will install your app in the built-in/internal storage and is not allowed to be moved to external/outside storage.
Therefore, in order to allow the system to install your app in external/external extended storage, you need to change android:installLocation the value of the property in manifest, android:installLocation set to " preferExternal O or" auto ".
If you declare " preferExternal ( android:installLocation ="), it preferExternal means that the system will install your app on external/externally extended storage, but the system must always do so. Assuming that the external/external storage is full, your app will still be installed in internal/built-in storage. When the user installs your app, users can move your app back and forth between external and internal/built-in storage.
If you declare " auto " ( android:installLocation = "Auto"), you intend to have the system install your app on the outside/external storage, but you do not have a particular preference for the installation location. So ultimately it is up to the system to consider a number of factors and then decide where your app will be installed, while users can still move your app back and forth between the external and internal storage.
For more details, please see the original Google Document, document link address: http://developer.android.com/guide/topics/data/install-location.html#Compatiblity
How does Android program to set the app installation location (external storage or internal storage)?