Java tutorial
//package com.java2s; import android.os.Environment; import java.io.File; import java.io.IOException; public class Main { public static File setOutPutImage(String name) { File outputimage = new File(Environment.getExternalStorageDirectory(), name + ".jpg"); if (outputimage.exists()) { outputimage.delete(); } try { outputimage.createNewFile(); } catch (IOException e) { e.printStackTrace(); } return outputimage; } }