May 12, 2021
1
0
15
I've been searching the internet for almost 7hrs now, I can't seem to find a code that works and it took me a while to find out that the method below no longer works and is deprecated

Code:
File file = new File(Environment.getExternalStorageDirectory(),sName);
file.mkdirs();

Also tried adding android:requestLegacyExternalStorage="true" in the manifest but still the same result.

So my question is: Is it possible to create a directory directly in internal storage automatically when the app starts for the first time, similar to what WhatsApp does?

Like if someone downloads and opens the app for the first time there'd be a new directory created (after gaining the permission to do so) in Internal Storage directly (not in Android/data sub-folders) for the app files in the future

And if it's possible, how can I do such a thing?

I'd be very grateful for as little as any pointer in that direction, I've been on this issue for much more time than I expected

Thank you in advance