Android app installation location details

Source: Internet
Author: User

Android applications can be installed on local built-in storage, or on External Storage (SD card ). After API 8, that is, android2.2, we can install APK on external storage. This is an optional feature that can be configured in the manifest file of the project:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"    android:installLocation="preferExternal"    ... >

As shown above, if it is declared as preferexternal, the APK is specified to be installed on the external storage, but the system does not guarantee that it can be installed on the external storage, so it is called preferexternal, for example, when the external storage space is full, the system will install the application on the internal storage. Users can move applications between internal storage and external storage. There is also a declaration option, that is, "Auto". If the attribute value is declared as this, the installation location will be determined by the system.

To install an application on external storage, make sure that the following conditions are met:

1. Specify the property value of Android: installlocation in the manifest file as "preferexternal" or "Auto ";

2. Ensure that the current system API level is 8 or above, and the Android: minsdkversion value must be more than 8 (Android 2.2 );


Note that when you connect your mobile phone to a PC and enable the large-capacity storage mode, that is, when reading the content of the external memory card, all applications installed on external storage will be killed by the system!

If your application exists in the following situations, it is not recommended that the application be installed on External Storage:

1. Background services are running in the application.

2. Registered Notification Services such as alarmmanager

3. Third-party input methods. If the third-party input method is installed on external storage, if the current external storage is suspended, the third-party input method will become invalid and be switched back to the system input method.

4. wallpaper theme application. When external storage is suspended, it is switched to the system default wallpaper or theme.

5. app Desktop component tool. If external storage is suspended, Widgets will be removed from the desktop.

6. register the application for the boot broadcast, because the system first sends the boot broadcast and then loads the external storage device. There is a sequence problem here.


For more information, see: http://developer.android.com/guide/topics/data/install-location.html


To join our QQ group or public account, see: Ryan's
Zone public account and QQ Group

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.