How To Read/set Default Install Location On Android Programmatically?
I know that the default install location of apps in Android can be retrieved by using adb method by invoking: adb shell pm getInstallLocation and can be changed by using: adb shel
Solution 1:
The App Install Location page of the Android Developer's docs provides information on setting the app install location and potential caveats.
To do so, you need to specify the installLocation
in your manifest, like so:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="preferExternal"
... >
Your options are:
- preferExternal: Install on the device's external storage whenever possible (not guaranteed)
- auto: Default to internal storage, but allow the user to move it to external storage
- internalOnly: Only allow installation on the device's internal storage.
You cannot set this in the app's code, as by the point any code executes the application has already been installed.
Post a Comment for "How To Read/set Default Install Location On Android Programmatically?"