Allow moving app to external storage

Expected behavior

In the app settings you should see the option to move it to external storage.
This is very important because in low performance phones like mine, the internal storage is very limited. Sometimes I have had to uninstall the app because it did not have enough space. This would be a great relief.

Actual behavior

No option to move app to external storage

Example Images

1 Like

in general, having such an option would be nice, however, it also comes at costs: things are harder to develop, debug and maintain.
moving apps to external storage also may degrade security as the storage is eg. not encrypted. also external storage is often slower.

for all of these reasons, it is currently not supported to move Delta Chat to external storage.

however, since Android 6, so called “Adoptable Storage” is available - that allows adding a SD-card transparent to the system, so that it really expands the system storage, including encryption. this works with all apps, including Delta Chat, and seems to be a good solution for low-budget phones.

1 Like

I think that @Atreyu94 means the system app settings, similar to this: https://www.howtogeek.com/114667/how-to-install-android-apps-to-the-sd-card-by-default-move-almost-any-app-to-the-sd-card/ - if we set android:installLocation="auto" in the <manifest> tag, then there will be an option to move the app to the SD card on pre-Android-6. See App install location  |  Android Developers.

Security is not a concern:

The .apk file is saved on the external storage, but all private user data, databases, optimized .dex files, and extracted native code are saved on the internal device memory.
The unique container in which your application is stored is encrypted with a randomly generated key that can be decrypted only by the device that originally installed it. Thus, an application installed on an SD card works for only one device.

However, getting notifications to work may be some extra work:

Your running Service is killed and isn’t restarted when external storage is remounted. Applications bound to this service can register for the ACTION_EXTERNAL_APPLICATIONS_AVAILABLE broadcast intent, which notifies all applications that aren’t installed on external storage when the applications installed on external storage have become available to the system again. After receiving this broadcast, applications can attempt to bind to your service.

Android InstallLocation - Stack Overflow explains the android:installLocation="auto" option:

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.

Since we currently aren’t specifying it, we are implicitly using the default "internalOnly".

2 Likes

thanks for the links and the additional explanations. i am obviously not that deep in that topic and at least some information i had in mind seem to be outdated :slight_smile:

The .apk file is saved on the external storage, but all private user data, databases, optimized .dex files, and extracted native code are saved on the internal device memory.

but that would not help much in our case at the end, or? i mean, our APK is 50 mb where the database is easily several 1000 mb. and if that comes with additional effort for notifications and issues when mounting as usb-device, i am not sure that this small benefit is really worth the effort, the additional maintenance and potential ux problems.
that seems to be more an option for eg. games with 1000 mb or so APK size.

using “Adoptable Storage” seems to have much more benefits then as that would move the 50 mb plus the maybe several 1000 mb database to the sd-card.

1 Like

Yeah, probably it’s not worth the effort.

1 Like