How to Create Folder in Android

How to Create Folder in Android - Hello friend inabnomaniiyaha, In the article that you read this time with the title How to Create Folder in Android, we have prepared this article well for you to read and take information in it. hopefully the contents of the post Artikel Android,what we write you can understand. Alright, happy reading.

Judul : How to Create Folder in Android
link : How to Create Folder in Android

Baca juga


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.

How to Create 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

That's it for the article How to Create Folder in Android this time, hopefully can be useful for all of you. well, see you in another article post.

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

Tips Tricks for Android Phone

Tips & Tricks for Android Phone is a free android app and Collection of Tips and Tricks related to using your android mobile device lik...