So I want to make a folder right in the main part of my internal storage. So basically the same area that you see when you plug your phone in your computer and you open up internal storage and see all those folders and files.
I've tried the following codes:
String path = Environment.getDataDirectory().getAbsolutePath().toString()+ "/storage/emulated/0/appFolder";
File mFolder = new File(path);
if (!mFolder.exists()) {
mFolder.mkdir();
}
Along with
ContextWrapper contextWrapper = new ContextWrapper(getApplicationContext());
File myDir = contextWrapper.getFilesDir();
// Documents Path
String documents = "appFolder";
File documentsFolder = new File(myDir, documents);
documentsFolder.mkdirs(); // this line creates data folder at documents directory
Along with a few others I've found online, but none of these seem to make a folder or at least on the internal storage that I want. I'm not sure if I'm missing something? But any help would be great, I've tried essentially copying a lot of posts I've seen online but none has even gotten me a folder? I don't get any errors either?
I have:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.name.app">
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
in my manifest, although I think I'm using gradle if that helps
-------------edit
Unfortunately I tried this from the url aswell, but still no folder.
ContextWrapper contextWrapper = new ContextWrapper(getApplicationContext());
File mydir = contextWrapper.getDir("mydir", Context.MODE_PRIVATE); //Creating an internal dir;