Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.os.Environment; public class Main { private static String mStorePath = null; private static Context mContext = null; public static String getStorePath() { if (mStorePath == null) { String path = Environment.getExternalStorageDirectory().getPath(); if (path == null || !Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { path = mContext.getFilesDir().getPath(); } if (!path.endsWith("/")) { path = path + "/"; } mStorePath = path; } return mStorePath; } }