View Single Post
Old 12-19-2019, 01:23 PM   #8
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,482
Karma: 8025704
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by stumped View Post
this is what I can't get my head around , if true.
lets say I just about squeeze a 4Gb HD video into the downloads folder of my android 9 tablet,
and I want to use a file explorer app to find it and hand it off to a video player,
its insane if that 4GB file then has to be copied / moved not pointed at. Even if there is sufficient storage to host a copy, it would take minutes, not seconds to made and hand off such a copy.
Here is what Google says. The relevant section is:
Quote:
Sharing Files Between Apps
For apps targeting Android 7.0, the Android framework enforces the StrictMode API policy that prohibits exposing file:// URIs outside your app. If an intent containing a file URI leaves your app, the app fails with a FileUriExposedException exception.

To share files between applications, you should send a content:// URI and grant a temporary access permission on the URI. The easiest way to grant this permission is by using the FileProvider class. For more information on permissions and sharing files, see Sharing Files.
A "content provider" in Android does exactly what it says, provides the content as a stream (or a database, but that isn't of interest for a book reader). If the recipient wants to be able to move around in the stream, for example re-read a chapter, then the recipient must make a local copy. Because permissions are temporary, if the recipient wants to be able to open the file again later then it must make a copy. If the recipient is happy to stream it once then no copy is needed.

When the problem arose I looked at the code in Android. There are no exceptions. And yes, this sucks as much as you think.

It is also the way iOS works. It sucks there too.
chaley is offline   Reply With Quote