I want to save file on phone. new File(directory, myCustomFolder)
.
1 - Environment.getExternalStorageDirectory() is not always access to save file. On some phones that don't have sd card not available and return nothing. :(
2 - getFilesDir() after unistall my app my files remove. (Is not the right place to store files) :(
3 - getCacheDir() after unistall my app my files remove. (Is not the right place to store files) :(
4 - getDataDirectory() after unistall my app my files remove. (Is not the right place to store files) :(
Please help me.Thanks
Environment.getExternalStorageDirectory()
GOOD WORKING.
solution is: android API 23+ need check dangerous permission:
https://developer.android.com/training/permissions/requesting.html