Java tutorial
//package com.java2s; import android.os.Environment; import java.io.File; import java.io.IOException; public class Main { public static File createImageFile(String imageFileName) throws IOException { File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); File image = File.createTempFile(imageFileName, /* prefix */ ".jpg", /* suffix */ storageDir /* directory */ ); return image; } }