I want to know,
Also I have an app which is installed in external storage. Im upgrading the app. The latest version of the app has flag to restrict install only in internal storage.
If your Android phone has an SD card slot, you can move apps out of internal storage. Storing apps on an SD card can free up space on your phone for other apps and data.
The good news is that if your device comes with expandable storage, you'll be able to move apps to an SD card. Additionally, you can turn your microSD card into internal storage. This will effectively make it possible to move apps to your SD card and all other data you may have on your phone.
Note: Only some apps can be moved to a memory card. Tap Storage. If the app supports changing where it's stored, a CHANGE button appears → tap CHANGE. Tap SD Card → MOVE.
The benefit of saving your files to your SD card or other external storage for that matter, is that you can swap them to a different device. This is particularly helpful when you want to share data with another device, upgrade your own device efficiently, or move files to long-term backup or storage.
Actually this does not seem a programatic question is more an Android OS
question.
First. As developer you don't choose HOW your app is installed, but since Android 2.2 you can choose WHERE:
Existing applications that were built prior to API Level 8 will always install on the internal storage and cannot be moved to the external storage
Since android API 8:
android:installLocation
internalOnly: Install the application on internal storage only. This will result in storage errors if the device runs low on internal storage.preferExternal: The android system tries to install the application on external storage. If that is full, the application is installed on internal storage.
auto: Let the Android system decide the best install location for the application. The default system policy is to install the application on internal storage first. If the system is running low on storage, the application is then installed on external storage.
As long as you programatically don't define the installation / moving process, Android operating system will take care of moving (if possible) from internal to external and viceversa. But as programmer you must be carefull with the type of app you are developing to know if you should or not allow this option
Warning: When the user enables USB mass storage to share files with a computer or unmounts the SD card via the system settings, the external storage is unmounted from the device and all applications running on the external storage are immediately killed.
What happens: As long as you don't decide, let's explain in a simple way. All files of the app are moved to sd card except one little pointer in the internal storage that tells the system where the app is located. (imagine if you format your SD card manually, then your phone won't know app has dissapeared) but if you unmount it phone won allow you to access.
Second Application updates will by default try to retain their install location, but application developers may change the installLocation field in an update. Installing an application with this new attribute on older devices will not break compatibility and these applications will be installed on internal storage only. That means, older data will be moved as long as the app remains with same identifier (and signature if market app).
Source / Source
ADVANTAGES / DISAVANTAGES
To keep / update your database files / configuration when upgrading your app check here and here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With