Changing android:installLocation from preferExternal to internalOnly
Asked Answered
D

2

12

I have an app on Google Play market and I added android:installLocation="preferExternal" to manifest.xml file and released long time ago. Now I would like to add Android home screen widget, so I need to change it to android:installLocation="internalOnly". If I do that, what happens when a user upgrades? because a user already installed the old app on SD card. What is the best solution for this situation??

If someone has this kind of experience, please advise me.

Thanks in advance :)

Dainedainty answered 25/3, 2013 at 16:32 Comment(0)
R
2

When you set install location to preferExternal the application specific files are stored in .android_secure directory in external sdcard.

These type of application are not available when user mounts the SD Card as USB Mass Storage (feature removed from Android Jelly Bean).

Coming to the question, I believe in your case the application would be installed onto internal memory with the files from .android_secure moved to internal location.

You can confirm this by the following:

  1. Install the application from play store having install Location as preferExternal.
  2. Confirm that your application is installed in external SD card, you can use Settings->App to check that.
  3. Now create your new signed application package.
  4. Install using adb install -r myapp.apk
  5. Again goto Settings->App and confirm the location.
  6. Run functional test to see if nothing is broken.
Rafflesia answered 25/3, 2013 at 16:54 Comment(0)
S
1

Old question, but according to my test, if an app is installed on SD card and you change afterwards the Manifest to android:installLocation="internalOnly" (or omit the android:installLocation attribute, which is the same), when the app is upgraded the package manager will automatically move the app from SD Card to internal storage. No idea what happens if this is not possible (not enough root on internal storage for example).

Slaton answered 31/7, 2020 at 10:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.