schulcloud-flutter
schulcloud-flutter copied to clipboard
Make it possible to view files without downloading them to storage
Is your feature request related to a problem? Please describe. Just like the native Android app, we should allow the user to view files without downloading them to storage.
Describe the solution you'd like We could possibly do that by downloading them to a temporary cache directory and starting an intent to open them.
Blocked by https://github.com/fluttercommunity/flutter_downloader/issues/263
Viewing files without downloading them to storage isn't exactly possible because other apps opening the files need them to be in the external storage. But I believe by solving #60 it doesn't become apparent to the user that the files are downloaded to the storage, so this should be fine.
@marcelgarus Not quite true. You can store downloaded files in your app's private directory and grant other apps temporary read access to it: https://developer.android.com/training/secure-file-sharing/share-file#GrantPermissions (This is implemented in open_file: https://github.com/crazecoder/open_file/blob/34dc2cbdeb0d49a83be59f66cbc6e1a258dc2420/android/src/main/java/com/crazecoder/openfile/OpenFilePlugin.java#L142)