Android SDCard Size Get 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;

public class Main {
    public static String getSDPath() {

        String state = Environment.getExternalStorageState();

        if (Environment.MEDIA_MOUNTED.equals(state)) {
            if (Environment.getExternalStorageDirectory().canWrite()) {
                return Environment.getExternalStorageDirectory().getPath();
            }//from   w w  w  . j a  v  a2s .c  o  m
        }
        return null;
    }
}

Related

  1. getMounts(CharSequence path)
  2. getMounts(CharSequence path)
  3. getAvailableMb(String path)
  4. getUsableSpace(File path)