Android SDCard Check getExtStoragePubDir(String dirName, String dirType)

Here you can find the source of getExtStoragePubDir(String dirName, String dirType)

Description

get Ext Storage Pub Dir

Declaration

public static File getExtStoragePubDir(String dirName, String dirType) 

Method Source Code

//package com.java2s;
import android.os.Environment;
import android.util.Log;
import java.io.File;

public class Main {
    public static File getExtStoragePubDir(String dirName, String dirType) {

        File path = new File(
                Environment.getExternalStoragePublicDirectory(dirType),
                dirName);/*from   ww  w . ja va2  s.c o m*/

        if (!path.mkdirs()) {
            Log.e("ExtStorageUtils", "Directory not created");
        }

        return path;
    }
}

Related

  1. isExtStorageReadable()
  2. isExtStorageWritable()
  3. isExternalStorageWritable()
  4. isExternalStoragePresent()
  5. getAlbumStorageDirectory(String albumName)
  6. getAvailableStorageSize(File dir)
  7. getDatafilesStorageDirectory(Context context)