Android Oreo (API 26) - Create dir in external storage
I have no problems running your existing code on a Nexus 5X running Android 8.0. Using adb shell ls /storage/emulated/0
, I see Chores/
, and inside there I see Processed Audio/
. This is for an app with WRITE_EXTERNAL_STORAGE
permission, including runtime permissions.
That being said, ideally, do not use string concatenation to create File
objects. Instead, use:
final File dir = new File(new File(Environment.getExternalStorageDirectory(), "Chords"), "Processed Audio");