Android‎ > ‎

Nested Directory Creation(Android)

posted Jan 24, 2013, 12:37 AM by Akash Khaitan   [ updated Mar 9, 2013, 7:44 AM ]
String pathstring=Environment.getExternalStorageDirectory()+"/test/audio/";
            File SDCardRoot = new File(pathstring);
            if (!SDCardRoot.exists()) {
                SDCardRoot.mkdirs();                        //mkdirs() for multiple directories
            }


Add writting permission in the mainfest
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Comments