-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android - Support selecting custom storage folder with scoped storage permissions for assets and saves #6666
Comments
App data isn't used as the res storage, it's on OBB for android 11 upwards. Even you manage to use SD Card or any location except it's app specific storage, the problem is the speed of access which will lead to unusable state. It's easy to point the specific location, the problem is accessing it without speed limitation. There are issue reported on google tracker like this: If you know how to bypass the speed limitation for public storage, please enlighten. |
First off I want to make clear that I am in no way patronizing any of the amazing work the maintainers, developers and contributors have done so far. If my issue came across this way, I apologize.
The google issue that you linked has already been marked as "won't fix". While a speed penalty is very present, I think that it is acceptable: the asset loader should run completely asynchronously from the rest of the engine, and assets will be initially generated with placeholders and then with the correct texture once it has been loaded (a certain amount of textures, based on the device hardware, should be cached). If this is not acceptable to the team, another solution could be creating an importer and an exporter for:
|
Currently forge loads all card data on startup. When I didn't use the OBB folder before, forge just simply froze on startup because of the speed penalty. The card scripts load before was 50,000 cards (now it's much larger than that). That's only card script. I didn't have a choice so I use the OBB folder to make forge playable on Android 11 and upwards. Only android 10 and below has the custom storage functions since it doesn't have this speed limitation. It's easy to enable that function but speed penalty will not be fixed by any workaround currently. Only google can decide if they allow to use public storage for use without scoped storage or any speed penalty. |
As long as the loading is clearly presented to the user with a loading bar (so the app doesn't appear frozen) I think most users will gladly take the trade off to be able to manage their own game data (being able to sync images, deck lists and adventure save data with other devices is a really nice feature to have!). And besides it would be an option: by default you would use internal storage, but if the user wants to they can select another place, maybe even with a prompt warning against the potential speed penalty. This is all valid also for importers and exporters: if you believe the speed penalty to make the game unusable, at least the importers and exporters would still allow the user to manage data. |
Sorry but I don't want to make Forge to be in unusable state for Android 11 and upwards users. If you want you can build the source and modify this line in Main.java
to
so it will use the original external directory.
and on Forge. java replace
to
forge/forge-gui-mobile/src/forge/Forge.java Line 134 in 4172256
and compile your own apk for use. With this change, The custom storage options in the Files Page will be available. But I don't encourage this change since this will only work without speed limitation. I've test this numerous times and its not feasible to wait for 20 minutes or more just to start Forge. Either use a third party File explorer to manage forge resources in the OBB folder or use a Custom ROM for your device that doesn't have scoped storage enabled. |
Is your feature request related to a problem? Please describe.
Ever since Android 13, the app data folder has become inaccessible for normal users. This makes it much harder to import/export assets and synching the save file between devices.
Describe the solution you'd like
Have an option to select the path where assets and sava data are stored and loaded from and use the android scoped storage system to ask for the correct permission.
Describe alternatives you've considered
The only alternative right now is either to not interact with the app data folder at all (and this makes managing the assets or synching the save impossible) or to enable developer mode in order to access the app data folder with ADB (something that only android developers would do).
Additional context
Android documentation on obtaining access to a directory's contents can be found here:
https://developer.android.com/training/data-storage/shared/documents-files#grant-access-directory
Here are some mock ups of how I would make it look (additional section in red for the sake of clarity):
The text was updated successfully, but these errors were encountered: