0

getExternalStorageDirectory() method is deprecated on Android. On every tutorial and stackoverflow question people reads file from root with getExternalStorageDirectory()

I tried to use getExternalFilesDir() but that method gives me my package path.

How can I get the path of root without getExternalStorageDirectory()?

Thanks in advance.

Emil Mammadov
  • 380
  • 4
  • 20
  • The root is "/". – blackapps Jan 19 '20 at 16:17
  • "How can I get the path of root without getExternalStorageDirectory()?" -- you can't. Moreover, you cannot access the root of external storage on Android 10 (by default) and Android R+ (for all apps). Use something else, such as `ACTION_OPEN_DOCUMENT` and the rest of the Storage Access Framework. – CommonsWare Jan 19 '20 at 16:34

0 Answers0