[Scummvm-tracker] [ScummVM :: Bugs] #12727: ANDROID: Allow Save location in SDcard (Write permission on SD)
ScummVM :: Bugs
trac at scummvm.org
Sun Jul 11 18:21:53 UTC 2021
#12727: ANDROID: Allow Save location in SDcard (Write permission on SD)
-------------------------------------------------+-------------------------
Reporter: LukasThyWalls | Owner: (none)
Type: feature request | Status: new
Priority: normal | Component: Port:
| Android
Version: | Resolution:
Keywords: Android, SDCard, Write permission, | Game:
Savegames, Feature request |
-------------------------------------------------+-------------------------
Comment (by antoniou79):
Replying to [comment:2 LukasThyWalls]:
>
> No, i am not getting it. I tried to choose the (real) sdcard directory
root (''/storage/9016-4EF8/''), the directory i want
(''/Juegos/ScummVM/Saves/'') but i'm not getting a "system" browser to
allow writing. The only thing i have is a message saying "The chosen
directory cannot be written to. Please select another one".
> Other apps like SyncMe Wireless or NewPipe do the thing you described
and they do it and then they can use the SD to write, but ScummVM is not
doing this.
>
Then a lot more testing is needed. SAF is supposed to bring up the "System
file picker". I'm on a Redmi Note 9 pro (Android 10), MUI 12.0.4 stable
and am getting that picker interface. (There's a new system update pending
though, so this is subject to change I guess).
It's just as well, because we need to:
- add further checks for when a permission is granted not at root level
but at folder level (most tests where done with permission at root level)
- support possible UTF-8 characters in paths
- test for save game functionality specifically (the feature was mostly
tested for the ScummVM LAN server)
- probably implement a way to revoke permissions granted with this browser
or
- recycle old ones as iirc there's a limit on how many of those
permissions we can have for ScummVM
>
> It's something i wanted to report, because is happening for a while. I
have this phone since more than two years and it never do this if i
recall.
> I didn't report earlier because i remember reading something about this
issue and people from ScummVM team saying they don't wanna fix it because
is an issue of Android itself for changing the framework again and again
and they don't wanna spend time in their constant changes... but it has
been a while since then, and now i remembered this and i don't find any of
that messages here, in open or closed tickets. Maybe they are in the
forums, or i have dreamed them...
>
That would probably be me, complaining about Google API updates. It's not
that I don't want to fix the issues that come up. It's that I'm not an
Android expert, not a dedicated Android porter and that the solutions are
rarely straightforward. And testing requires a lot of time on multiple
emulator configurations and devices, and the constant and serious API
updates keep requiring more maintenance or updating of the code -- a time
that I prefer to spend elsewhere (eg. like the Blade Runner engine).
I do not express the sentiment of the whole team, though. Just my own
thoughts on the matter. We all do work on a voluntary basis and each has
their own priority on tasks to be worked on. I have a few Android devices
and I would like ScummVM to run smoothly on them, so that's my main
motivation on working on it.
Also keep in mind, in the last 2 years the Android port got a major
update, to bring it up-to-date with the ScummVM core features and new game
engines. And we keep hacking at bugs and improving existing features when
possible and when time and life allows.
Anyway here's my summary of it. Android (Google) has radically tightened
security wrt what an app can do with storage (and other stuff, but here
we're mostly interested in storage). Unfortunately the ScummVM paradigm is
not really the standard app they have in mind making these changes. And
they do keep changing stuff which makes maintenance a chore for developers
of apps outside the self-contained app norm, like ScummVM.
Ideally we will keep/fix supporting storing on an SD card in the newer
Android versions, which seems like the proper thing to do, but jumping
through hoops to achieve that is diminishing for any enthusiasm and
motivation.
Also, the listing of directories (the second issue addressed in this
ticket) is (again) going to have to change, since as of sometime this
year, and in Android 11 and above, some of the functions we use to find
the available storage options will cease to work (as deprecated). And this
is yet another potentially huge thing to deal with, since Android vendors
are very inconsistent in following a standard for external storage, so you
cannot have hardcoded paths, and the code for accommodating all cases
becomes a spaghetti nightmare.
>
> I point that out because maybe is related to the other issue, but if you
can access to all the directories needed it's not an issue, and looking
where go all the shorcuts, you can go where you need.
> I'm only saying the names doesn't match where they go and they are a
little confussing: At least in my phone, the ''sdcard'' is not the real
sdcard, is the internal storage, the ''data (ext)'' is the ScummVM data in
internal storage, and the ''data (int)'', is the /data directory in the
"system"? storage (or whatever is called, the root linux partition what
have all the OS), what also is empty for me because is unnaccessible
without root.
Again, that's Android for you. And its onomatopoeia.
They have a system "sdcard" folder, but it does not correspond to the
user's external sd card (I think it never did).
Then, an Android app has an internal storage and an external storage, but
both of those are actually allocated in "internal" storage space. And both
will get deleted (wiped) when uninstalling the app. App external storage
differs from App internal storage only in that external storage can be
accessed from other apps, but internal cannot. Both of these storages are
guaranteed to exist -- they don't depend on external physical storage, and
the app has access to these spaces always without requiring permissions to
read/write. These are the ONLY spaces a modern Android OS app is allowed
to write without asking for explicit permissions.
I think the other link (ScummVM data) is there for compatibility with
older versions of Android OS (and ScummVM).
Anyway...
ScummVM has implemented LAN server and Cloud Saving, so those could be
used to work around the storage nightmares, at least until we (hopefully)
sort out this new API stuff.
--
Ticket URL: <https://bugs.scummvm.org/ticket/12727#comment:3>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list