OpenStreetMap

Why we should care about googles scoped storage on Android

Posted by SimonPoole on 2 May 2019 in English. Last updated on 3 May 2019.

Some of you may have heard of the upset around the introduction of “scoped storage” in the upcoming Android Q (10) release, see for example androidcentral

So why should you care about this change, after all it promises to enhance users privacy, and it isn’t exactly new that the goog doesn’t really care about burning developers time?*

Well there is a special angle to this new feature for “geospatial” apps, it essentially inhibits direct file access and assumes content can be accessed as a stream of bytes. That is all fine and dandy if you are writing something that just access pictures, videos and other media files, but it breaks down as soon as we are using larger structured files.

Classic example a MBTiles format file containing images or vector tiles or anything else, or a geopackage file and so on. Now there are workarounds of sorts, but they essentially all require copying around potentially multiple GBs of data, potentially duplicating it on device and are not really practical or user friendly.

A further twist is that a user will typically want to persist larger downloads over app de- and reinstalls, data in app private directories doesn’t survive this. For example vespucci creates a separate directory exactly to circumvent this issue.

See https://commonsware.com/blog/2019/03/26/death-external-storage-can-haz-file.html for some more information and https://issuetracker.google.com/issues/128591846#comment50 is a comment from a well known Mapbox developer (in case you are wondering why the later doesn’t turn up when googling, yes, the goog doesn’t actually index its own issue tracker).

Now, after protests, google has essentially pushed back enforcement of this by a year to Android R, but that is just kicking the can down the road a bit.

*In the case of paid devs, well they are paid, the others are simply expected to spend a couple of $1000 per year equivalent amount of time to accommodate whatever google has decided to break this time around,

Discussion

Comment from Marcos Dione on 2 May 2019 at 16:27

the goog doesn’t actually index its own issue tracker

And you have to have a google account to even read that. I wonder what it says…

Comment from SomeoneElse on 3 May 2019 at 09:37

the others are simply expected to spend a couple of $1000 per year equivalent amount of time to accommodate whatever google has decided to break this time around,

A cynic might argue that Google are merely playing catch-up with Apple here :)

More seriously anything that makes development harder disproportionally affects smaller and genuine for-free developers. That I’m sure is the reason why “small proof of concept apps that do something interesting with OSM data” are far more common on Android rather than iOS currently.

Comment from ConsEbt on 15 May 2019 at 01:38

Are there plans to combine other use cases that struggle with the stream of bytes. Is there a potential to find a common, stronger voice among the android users to impress on google?

Comment from SimonPoole on 15 May 2019 at 05:44

@ConsEbt “users” don’t really factor in here, there is some unrest among developers (because these are the people that will be blamed when they have to remove functionality), but those that don’t create the umpteenth rehash of media player/gallery/etc.are a minority to start with. For google to pay attention it would need to have a substantial impact on their revenue stream from paid apps and that is unlikely to happen.

Comment from SimonPoole on 11 December 2023 at 15:14

Small update: about a year or so back, google did actually start indexing the Android bug tracker.

Log in to leave a comment