I'm trying to create a folder in the internal storage of the device where the user can access the data (don't wanna do the folder here: /data/data/package.name/app_MyDirName).
After a lot of researching, i have that but there's always an error creating the file:
public void createFolder(View v){
File folder = new File(Environment.getDataDirectory() + File.separator + "YOUR_FOLDER_NAME_HERE");
if (!folder.exists()) {
if(folder.mkdirs()){
Log.d("App","file created successfully");
}else{
Log.d("App","error creating folder");
}
}else{
Log.d("App","folder exists");
}
}
I've been trying to solve this for a while so I would be really thankful if someone could help me!