Java tutorial
//package com.java2s; import android.content.Context; import android.os.Environment; import java.io.File; public class Main { public static File getTempFile(Context context) { //it will return /sdcard/image.tmp final File path = new File(Environment.getExternalStorageDirectory(), context.getPackageName()); if (!path.exists()) { path.mkdir(); } return new File(path, "image.jpg"); } }