0

this is how I was accessing folders before Android 11.**

File someFolder = new File(Environment.getExternalStorageDirectory() + "/somefolder);

but this method not working(deprecated) in android 11.

getExternalFilesDir () - this method returns the application's folder. Android/data/someApp

permissions:

   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Is there any way you can suggest?

  • 2
    I do not exactly understand what your question is, but maybe the Android 11 Storage Update docs helps you to find an answer: https://developer.android.com/about/versions/11/privacy/storage – Brimbo Feb 27 '21 at 17:05
  • Please see for example this question for more details on scoped storage: https://stackoverflow.com/questions/64189667/write-permissions-not-working-scoped-storage-android-sdk-30-aka-android-11 – Robert Feb 27 '21 at 17:16
  • example i want to access Telegram folder. how can i do this? – Suret Ramazanov Feb 27 '21 at 17:19
  • `hi, this is how I was accessing files before Android 11.` Apart from creating a File object that code does nothing. On no Android version. It does not access folders. It does not access files. It does nothing. – blackapps Feb 27 '21 at 17:28

1 Answers1

-1

I don't exactly know if it's what you mean but you can try to look for the next: Android getFileDir vs getDir