Where to install Android apps

Source: Internet
Author: User

the default installation location for Android apps and whether they can be moved depends on the developer's settings in their androidmanifest.xml: <manifestxmlns:android="http://schemas.android.com/apk/res/android" Android:versioncode="1" android:installlocation="Auto" android:versionname="1.0">  Android:installlocation has a value of three internalonly ,auto,preferexternal, The default value is Internalonly internalonly indicates that the application can only be installed in the phone's internal storage. Auto indicates that the system determines whether the application is installed in the phone's internal storage or the SD card. If you have an SD card and the application is larger than 5M, install it into the SD card, otherwise it will be in the phone's internal storage .preferexternal indicates that the application can only be installed to the SD card if an SD card is available, otherwise it will be installed in the phone's internal storage.   when Android:installlocation is internalonly, the user is " Setting", "Application", "Manage Applications "cannot move applications between SD card and memory when android:installlocation is auto or preferexternal, the user is " Setting", "Application", " Manage applications "allows applications to move between SD cards and memory  In addition, the ADB shell can use the pm setinstalllocation 2 command to forcibly change the installation location. 2 represents the force installed on the SD card,0 for Automatic, and1 for the mandatory loading into the phone's internal storage.  In the code, for phones higher than Android 2.2, the applicationinfo.flag_external_storage tag can be used to determine if an app is installed on SDcard. For phones that are below Android 2.2, you can determine the location of the APK installation by ApplicationInfo the SourceDir property to the beginning of the/sdcard/.  Example 1 packagemanager pm=ctx. Getpackagemanager(); applicationinfo appInfo=pm. Getapplicationinfo(pkgname,0); if(appInfo. Flags &applicationinfo. Flag_external_storage)!=0){ //App on SDcard System.out.println (pkgname+ "Install on SDcard");

Where to install Android apps

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.