Java tutorial
//package com.java2s; import android.os.Environment; public class Main { private static String sdRootPath = Environment.getExternalStorageDirectory().getPath(); private static String appRootPath = null; private final static String FOLDER_NAME = "/md4uImages"; private static String getStorageDirectory() { return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED) ? sdRootPath + FOLDER_NAME : appRootPath + FOLDER_NAME; } }