SD card SDcard get external storage directory Android

Environment.getExternalStorageDirectory()+ File.separator

Boolean canWrite =	Environment.getExternalStorageDirectory().canWrite() ;
if(canWrite){
File f = new File(Environment.getExternalStorageDirectory()
                        + File.separator + "my_image.jpg")
f.createNewFile();
}else{
 
}

AndroidManifest.xml

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
This entry was posted in Android Examples Code and tagged . Bookmark the permalink.


Comments are closed.



11,305 views