Android SDCard Check getSDPath()

Here you can find the source of getSDPath()

Description

get SD Path

Declaration

public static String getSDPath() 

Method Source Code

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

public class Main {
    public static String getSDPath() {
        String path = null;// w  ww  . j  a va 2 s.c  om
        if (hasSdcard()) {
            File f = Environment.getExternalStorageDirectory();
            path = f.toString();
        }

        return path;
    }

    private static boolean hasSdcard() {
        String status = Environment.getExternalStorageState();
        if (status.equals(Environment.MEDIA_MOUNTED))
            return true;
        else
            return false;
    }
}

Related

  1. hasMountSDCard()
  2. getExternalStorageFreeSize()
  3. getExternalStorageTotalSize()
  4. generateLogOnSD(String sBody, String fileName, String folderName)
  5. getDataFilesDir(Context c)
  6. getSdCacheDir(Context context)
  7. getSdcardFilesDir(Context c)
  8. hasSdcard()
  9. isSDCardPresent()