I want to write an image file to sd card, but i get an error :Open Failed eacces permission denied.
i am using this code:
File ff = new File("/storage/sdcard1/DCIM/100ANDRO/DSC_0258.JPG");
try{
ff.createNewFile();
} catch (Exception e){
Log.d("error" , "creating");
e.printStackTrace();
}
I have added permission :-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
and
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
I am not using android 6.0 , so permission is not required at run time.
The same code works fine when file path changed to internal storage path.
but still getting error.