Java tutorial
//package com.java2s; //License from project: Creative Commons License import android.os.Environment; import java.io.File; public class Main { public static String getPathForFile(final String filename) { return (getPathForSharedStorage() + File.separator + filename); } public static String getPathForSharedStorage() { String storage = Environment.getExternalStorageDirectory().toString(); //String storage = "/storage/emulated/0/"; // this is what my device is seeing for above call //String storage = "/sdcard"; // because gmail can't read it, as the file must be in a 'sharable' location return storage; } }