Java tutorial
//package com.java2s; import android.os.Environment; import java.io.File; public class Main { public static String getSDPath() { File sdDir = null; boolean sdCardExist = Environment.getExternalStorageState().equals("mounted"); if (sdCardExist) { sdDir = Environment.getExternalStorageDirectory(); } else { sdDir = Environment.getRootDirectory(); } return sdDir.toString(); } }