Judul : How to Create Folder in Android
link : How to Create Folder in Android
How to Create Folder in Android
How to Create Folder in Android
External storage is a secondary memory/sdcard of your phone, which we can use to save files world-readable. We can use the mkdirs() method to create the folder in Android.

Function
public String getStorageDir(String fileName) {
//create folder
File file = new File(Environment.getExternalStorageDirectory() + "/folderName/folderName1");
if (!file.mkdirs()) {
file.mkdirs();
}
String filePath = file.getAbsolutePath() + File.separator + fileName;
return filePath;
}
To read or write to the external storage (sdcard), you need to add the permission code in the manifest file
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
That's the articleHow to Create Folder in Android
You are now reading the articleHow to Create Folder in Android with link addresshttps://inabnonapudyawanabing.blogspot.com/2020/11/how-to-create-folder-in-android.html
0 Response to "How to Create Folder in Android"
Post a Comment