Questions tagged [scoped-storage]

A feature presented on Android Q, to sandbox storage of apps.

from the docs:

To give users more control over their files and to limit file clutter, Android Q changes how apps can access files on the device's external storage, such as the files stored at the path /sdcard. Android Q continues to use the READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permissions, which correspond to the Storage user-facing runtime permission. However, apps targeting Android Q by default (as well as apps that opt into the change) are given a sandboxed view into external storage.

By default, if your app targets Android Q, it has a sandboxed view of the files that are on an external storage device. The app can store files intended for itself under an app-specific directory in the sandbox using Context.getExternalFilesDir().

An app that has a sandboxed view always has access to the files that it creates, both inside and outside its app-specific directory.

333 questions
52
votes
2 answers

How to get information of an APK file in the file system (not just installed ones) without using File or file-path?

Background My app (here) can search for APK files throughout the file system (not just of installed apps), showing information about each, allowing to delete, share, install... As part of the scoped-storage feature on Android Q, Google announced…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
26
votes
5 answers

Android Q (10) ask permission to get access all storage. Scoped storage

In Android 10 apps that need to access storage need to ask permission to access a concrete path. But apps like file explorer can ask permission for access to the root storage and gain permission to read/write to all storage. That is what I am trying…
user2983041
  • 1,761
  • 4
  • 19
  • 31
22
votes
1 answer

How to obtain MANAGE_EXTERNAL_STORAGE permission

I'm trying to get the MANAGE_EXTERNAL_STORAGE permission on my Android 10 (API 29) device. https://developer.android.com/training/data-storage/manage-all-files Manifest:
Serhii K.
  • 639
  • 1
  • 8
  • 17
21
votes
5 answers

Android 10: How to delete MediaStore item and it's associated data on file system programmatically?

I am updating my app to use Scoped Storage feature introduced in Android 10. My app works with MediaStore and displays images, videos and audio files and provides ability for user to delete item. What I did earlier to delete file: Got path from…
artman
  • 632
  • 2
  • 7
  • 16
14
votes
1 answer

Test programmatically if in Android 10+ the legacy external storage access is disabled

Is there a simple API call that would tell me if an app running on Android 10 or later must use Scoped Storage access, that is, if the normal file access, a.k.a. "Legacy External Storage" is disabled? Note that even if the app in…
gregko
  • 5,642
  • 9
  • 49
  • 76
13
votes
2 answers

FFmpeg: seeking not possible with file descriptor on Android Q

Given the fact that public file paths will generally not be available in Android Q with scoped storage, I am attempting to figure out how to make my FFmpeg audio decoder work with file descriptors, without copying the file to my app's private…
Steve M
  • 9,296
  • 11
  • 49
  • 98
12
votes
2 answers

Writing files to publicly accessible documents folder in Android Q - Scoped Storage

Background After migrating to Android Q I can no longer find a suitable way to gain write access to the documents folder (/storage/emulated/0/Documents) And before anyone mentions the many other questions on scoped storage I've read through many of…
Jameson
  • 190
  • 1
  • 11
12
votes
1 answer

Android Q, how to save audio recording with MediaStore with the correct file name?

I want to store my mp3 files recorded with my app to the Music folder with MediaStore for the new "Scoped Storage" of Android 10. This method works good, but the files are named with timestamp (e.g. 1576253519449), without .mp3 extension. If I add…
devpelux
  • 2,492
  • 3
  • 18
  • 38
11
votes
2 answers

Android - accessing files in native C/C++ code with Google Scoped Storage API

I need to open files by file name in Android apps within native C/C++ code. The native code are 3rd party libraries that I would prefer not to modify, but they often require file name as an argument to read/write files. With the Google's "scoped…
gregko
  • 5,642
  • 9
  • 49
  • 76
11
votes
2 answers

How to resolve Android 10's Storage Mess

As Android is very inconsistent between different major Versions regarding File access, I feel a bit lost. I try to describe the problem as easy as possible: My Company uses a commercial native DRM to protect other native library's we provide. We…
10
votes
4 answers

Google Play App Rejection - Not a core feature - Use of All files access

I have an application on play store to whom the targetSdkVersion is update to 30 from 29, which is getting rejected again and again by Google Play after an update. Previously, there was a permission of MANAGE_EXTERNAL_STORAGE in one of the SDK…
10
votes
1 answer

Access photos from external storage in Android Q

I recently upgraded the app's target version to API 29. Due to the scoped storage in Android 10, i used MediaStore API to store and retrieve images from app external storage. Earlier, i used getExternalStoragePublicDirectory to store images taken…
Madhan
  • 361
  • 4
  • 17
10
votes
4 answers

DownloadManager not working for Android 10 (Q)

I've been beating my head against this issue for quite awhile... I am updating an app that uses DownloadManger to do a simple task like downloading a file to the external storage public directory…
9
votes
1 answer

Why doesn't require WRITE_EXTERNAL_STORAGE on Android Q and higher

I use DownloadManager to download a photo and save it to external pictures directory: .setDestinationInExternalPublicDir(Environment.DIRECTORY_PICTURES, File.separator + filename) Marshmallow requires WRITE_EXTERNAL_STORAGE (as expected) but on…
9
votes
2 answers

Scoped Storage: how to delete multiple audio files via MediaStore?

I'm trying to delete audio files from the device's external storage (for example in the /storage/emulated/0/Music folder). After analyzing the MediaStore sample, I ended up with the following solution for API 28 and earlier: fun…
Thibault Seisel
  • 1,197
  • 11
  • 23
1
2 3
22 23