nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.2k stars 1.75k forks source link

Make your app movable to SD card. #7852

Open fckwan opened 3 years ago

fckwan commented 3 years ago

http://programmerguru.com/android-tutorial/how-to-create-android-app-with-movable-to-sd-card-feature/

Please make your app movable to SD card.

https://developer.android.com/guide/topics/data/install-location

bananer commented 3 years ago

On my device with Android 10 (Lineage 17.1) I have storage path in the Nextcloud app configured as /storage/emulated/0/Android/media/..., all my synchronized folders take up space on the internal storage.

There is no obvious way to have Nextcloud synchronize to my sd card instead of the phone's storage. The "Storage" permission is granted.

Reading through #5610 there could be one solution having the user pick a storage location on the sd card via Android storage framework.

Moving the app to sd card via install location seems to be an alternative, which might be a lot quicker to implement (adding installLocation attribute in manifest). Other apps with high storage requirements (e.g. OsmAnd) seem to have implemented that and can be moved to the sd card with all their data from the Android settings storage page. However, there might be valid reasons against doing the same for Nextcloud like the ones listed on the Android documentation.

Would a pull request to change the installLocation have any chance of being accepted?

AndyScherzinger commented 3 years ago

Moving the app to sd card via install location seems to be an alternative, which might be a lot quicker to implement

This a Android App Feature we explicitely removed since the account management (and likely the scheduled jobs) won't work rendering the app broken (which is something we can't change as in Android account management integration). So @bananer's suggestion (changing the data storage location wihtin the app's settings) is as close as it gets.

cc @tobiasKaminsky for confirmation

bananer commented 3 years ago

To be clear, changing the data storage location within the app's settings does not allow me to move my data to sd card.

AndyScherzinger commented 3 years ago

@bananer what do you mean your data? The files you manage within nextcloud or the app and it's database? Or do you mean the list of storage locations doesn't offer a path pointing to your sd card?

bananer commented 3 years ago

I'm talking about the files I manage within nextcloud.

Here are some screenshots that show how the ~16GB of files I've synchronized to my phone end up in my internal storage, not on the sd card:

Screenshot_20210121-193920_Nextcloud (Klein) Screenshot_20210121-193956_Einstellungen (Klein) Screenshot_20210121-194017_Einstellungen (Klein)

AndyScherzinger commented 3 years ago

Which options are shown in the List of 'Speicherort' in the Nextcloud Android app?

bananer commented 3 years ago

These are the other two options:

IMG_20210122_081454

When I try to select any of them, it fails with message "Mehr Speicherplatz benötigt"

AndyScherzinger commented 3 years ago

@tobiasKaminsky any ideas?

Croydon commented 3 years ago

I can confirm the problem @bananer has.

Despite having chosen a path that points to the SD card, Nextcloud still seems to save the data on internal storage