Preparing for scoped storage (Android Dev Summit '19)



Plan overview and best practice guide to the new storage model in Android 10.

Presented by: Roxanna Aliabadi‎, Zimuzo Ezeozue, Yacine Rezgui

Android Dev Summit ’19 all sessions playlist →

Subscribe to the Android Developers channel! →

Check out the photo album →

#AndroidDevSummit event: Android Dev Summit 2019; release: Publish;

41 Replies to “Preparing for scoped storage (Android Dev Summit '19)”

  1. Anthony Dunk

    Personally I think scoped storage is a terrible idea and is going to cause a lot of trouble for developers and users alike. If introduced, it should only be for new apps, not existing ones.

  2. Universe Studio

    It's that was smart permission is a question to the owner to state period limit so the user can choose how long they have permission time limit.
    Permission should be temporarily like 5 Seconds 10 second 30 seconds

  3. Danish Ansari

    I don't understand how is WhatsApp and Telegram able to create files on external directory as they have "WhatsApp" and "Telegram" directory.

    Also I have a requirement that my app files should retain eve after my app is uninstalled. How do I do that?
    Let's say that I add `hasFragileUserData` in Manifest and my data is retained after uninstallation, but then an ordinary user is not so much knowledgeable enough to go inside /Android/data/app.package.name/ and access the files.

    If your solution is to add MANAGE_EXTERNAL_STORAGE permission. I'm developing an SDK not App. Why should I concern my user(another developer) to comply with Google policy. And again I'm sure you will reject the app with this permission only required for storing PDFs (which my SDK creates)

  4. 8-Bit Modern

    I mean at least let us have access to everything through the file explorer. I have an s20 and now chrome is absolutely useless, I had about 48+ GB of data on my SD card in chrome data folder which now I can't access without root which will void my warranty, he'll I can't even see the data folder through a USB cable on another device. At least give writing and reading access to all apps in my file explorer for developing sake.

  5. Lothar Scholz

    I have a content management application. How can i add my own metadata to all files? Either embedded in the file data or as extended attributes to the file? How can i use inode tracking to find changes made to media now automatically? What if the media is a PDF, Zip File or ASCII text and not audio,image,video?

  6. HJ Chin

    I have to relearn Android technologies for every 2 years. I come and watch this video after camera stop working in 2020. Maybe another changes in 2022 and my app stop working again.

  7. Diego Almeida

    If I access an image and need its EXIF info to fix it's rotation, which is a very common problem, how am I going to do it without having access to file path? Is MediaStore going to provide the image with rotation fixed? If not it then it looks like we will need to force the Uri to keep original file content, which seems to require ACCESS_FILE_LOCATION. If that's also not an option for the app, we might need to do something at a low level such as what Glide does, or use Glide to fix it (and trust that it is really able to fix it)
    https://developer.android.com/reference/android/provider/MediaStore#setRequireOriginal(android.net.Uri)
    https://developer.android.com/training/data-storage/shared/media#location-info-photos

  8. Woomin Park

    Deleting images created by other apps doesn't work. It only removes the entry from the content provider database, not the actual file. What's worse is that once you open the Photos app, the image gets re-registered into the database with a new ID. There are issue tracker reports. Please fix this before 11 comes out!

  9. Jim Andreas

    Hi All. I was here looking for clarity on how to drop some PDB (protein data bank) files on a phone and then find them using a 3D protein viewer (under development) programmatically. I was hoping for some sort of guidance. That this presentation was confusing is an understatement. Will keep looking.

  10. Fanny Jim

    No No No, Google, this is not enough for good user protection and usability, need more protection. You must add more protection mechanisms.
    Please make access to files more complicated, you can do it, i believe in you.
    I have a good idea for next version of Android: Storage Api should send access request directly to the Google Central Office each time when user wants access to a file(e.g: open or save pdf file or save xls file), user should get access to a file only after Google Central Office confirmation.

  11. Khamidjon Khamidov

    I seem not to suggest my friends to be android developer as it is becoming worse. Even users want to have a better management of files by different apps they want. Now it seems not to be the case. Good bye free android world! Welcome endless limitations!

  12. Mikko Rantalainen

    @Android Developers: how about allowing full storage access for apps if the "user" is a developer? I'm fine with selecting myself which apps get full access to shared storage. If I only wanted to use "media files" I'd be using iOS already. I want hex editor, file manager, proper text editor and other stuff that makes no sense to any casual user. And I want root access when I decide it.

  13. Tomáš Procházka

    What exactly you mean by "Unfiltered view od MediaStore", when FileManager app will be whitelisted? It will work like on Android 9? Normally with File class?

    And. I agree that better protection is good, but API based on Cursors? Really? For example java.nio has the ability to create custom FileSystem very easily and it works the same as native filesystem. Please follow this way.

  14. Giuseppe G

    Thanks for this presentation, but the scoped storage it's terrible.
    The idea behind is good, but it's impossible for most apps use those APIs. An example is an enterprise app which writes log files (and append lines while running) in folders on ext storage using pure java libraries like log4j. This will break most of enterprise apps and most of MDM solutions. A very easier approach could have been involved a standard permission request (maybe specifying the directory) and when granted allow developers to keep using standard java IO classes to do any operation inside the folder.

  15. Aleksandar Mlazev

    And what about apps that have and introduce custom file formats with custom mime type and those files are created by user's time and efforts. I have a guitar notation app – Guitar Tabs X – and now I have to store the songs written by the user in the Downloads collection ?? Those songs can also be exported to MIDI or PDF and how you imagine those connected files to be scattered in different collections or worse – to be deleted if the user uninstalls the app??? Now the app creates one public external storage folder and stores everything inside. That folder can be easily deleted by the user but will stay if the user uninstalls/installs the app as there are the files created by the user! Why not keep that approach and let apps create and use one persistent folder?

  16. Linden Tree

    Our app creates and manages files that are not supposed to be deleted "automatically" when the app in uninstalled. The user invested time and effort, the files are the result and they should not just disappear. I'm sure a lot of other apps have the same concern.
    Hey Google, just provide a new folder that can survive an uninstall-reinstall event, or an uninstall-I-still-need-the-files event. And it's not about one single file or a one-by-one low performance copy through SAF, it's a large directory tree with fast access from native code. Maybe something the user can allow with OPEN_DOC_TREE or something, but accessible form native UNIX code and File class.
    We're now preparing an update: Well ask permission from the users to copy the data from the current safe-from-uninstall location, easily accessible with file managers (to copy files in and out) to the hidden private folder. And with the big warning "don't forget to export everything as zip before uninstalling". Ridiculous.

Leave a Reply

Your email address will not be published. Required fields are marked *