AM2R-Community-Developers / AM2R-Community-Updates

Source code for AM2R 1.5.2+, free of copyrighted assets and trademarks.
https://www.reddit.com/r/AM2R/
Other
137 stars 25 forks source link

Legacy storage on Android for savegames #119

Open eadmaster opened 1 year ago

eadmaster commented 1 year ago

Is your feature request related to a problem? Please describe. I'd like to backup and restore my saves without rooting the device.

Describe the solution you'd like set the LegacyExternalStorage flag in the app manifest and change the savegames location to /sdcard/AM2R.

Mame4Droid is currently providing this as an option.

Describe alternatives you've considered Rooting the device.

Additional context Add any other context or screenshots about the feature request here.

Lojemiru commented 1 year ago

Hmm. I like the consideration to make saves accessible/non-deleted between installations, but this seems to rely on functionality that will likely be phased out in the near future (knowing Google's approach) and I'm not entirely sure we can even repoint GameMaker at that directory if we were to get the flag into the app manifest.

Worth looking into at some point, but I'll be up front and say it's not a huge priority what with the current internal process going on unless @Miepee decides to take on some Android pain.

eadmaster commented 1 year ago

An alternative, we may have a manual save import/export feature into the app own scoped storage.

Miepee commented 1 year ago

I'd like to backup and restore my saves without rooting the device.

You actually can. I found a way to do that, but forgot to document it publically / put it on faq Only works tho, if you're on Android 11 or less (or in other words, will not work for Android 12 and higher).

set the LegacyExternalStorage flag in the app manifest and change the savegames location to /sdcard/AM2R.

I am not that familiar with Androids storage systems that developed over the years. In order for your approach to work, would one need to do both, or would simply setting the LegacyExternalStorage be enough? Because for GameMaker games, changing the save location is simply not possible. The runner doesn't allow you to access anything (regardless of reading or writing) outside of /data/data/<package name>/files See the old GMS1.4 documentation here This also means, that a "save import/export"- feature would also be impossible to implement.

MAME4droid is able to get away with that, because they have the possibility to write their own apk and code for it. With GameMaker (which is what the project is written) we do not have such luxury, as we're bound to whatever YoYoGames decides would be best.