Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between auto and preferExternal instal location Android manifest

What is the difference between auto and preferExternal instal locations in android manifest? Both options can instal application on External memory. Is it something big and important? Which is better to set?

like image 695
Slim C. Avatar asked Apr 23 '14 09:04

Slim C.


People also ask

Where is the Android manifest file located?

The file is located at WorkspaceName>/temp/<AppName>/build/luaandroid/dist. The manifest file provides essential information about your app to the Android operating system, and Google Play store. The Android manifest file helps to declare the permissions that an app must have to access data from other apps.

How do I install storage on my Android?

Go to Settings > Security > Credential Storage, and then tap Install from storage. 4. Tap the certificate you want to install.

What is used by the Android system to uniquely identify your app?

By default, Android assigns each app its own unique user ID. However, if this attribute is set to the same value for two or more apps, they will all share the same ID — provided that their certificate sets are identical. Apps with the same user ID can access each other's data and, if desired, run in the same process.


2 Answers

As stated in the Android Api Guide,

Beginning with API Level 8, you can allow your application to be installed on the external storage (for example, the device's SD card). This is an optional feature you can declare for your application with the android:installLocation manifest attribute. If you do not declare this attribute, your application will be installed on the internal storage only and it cannot be moved to the external storage.

I believe It is better to declare android:installLocation because,

  • Internal Storage is limited in some devices.
  • User has the option to move the application between Internal and External Storage.

The attribute android:installLocation can have following possible values.

"internalOnly" : The application must be installed on the internal device storage only. If this is set, the application will never be installed on the external storage. If the internal storage is full, then the system will not install the application. This is also the default behavior if you do not define android:installLocation.

"auto" : The application may be installed on the external storage, but the system will install the application on the internal storage by default. If the internal storage is full, then the system will install it on the external storage. Once installed, the user can move the application to either internal or external storage through the system settings.

"preferExternal" : The application prefers to be installed on the external storage (SD card). There is no guarantee that the system will honor this request. The application might be installed on internal storage if the external media is unavailable or full, or if the application uses the forward-locking mechanism (not supported on external storage). Once installed, the user can move the application to either internal or external storage through the system settings.

like image 75
The Holy Coder Avatar answered Sep 30 '22 23:09

The Holy Coder


If you declare preferExternal, you request that your application be installed on the external storage, but the system does not guarantee that your application will be installed on the external storage. If the external storage is full, the system will install it on the internal storage.

If you declare auto, you indicate that your application may be installed on the external storage, but you don't have a preference of install location. The system will decide where to install your application based on several factors. The user can also move your application between the two locations.

reference http://developer.android.com/guide/topics/data/install-location.html

like image 38
Spring Breaker Avatar answered Oct 04 '22 10:10

Spring Breaker