Here you can find the source of getSDPath()
public static String getSDPath()
//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; } }