Java tutorial
//package com.java2s; import android.os.Environment; import java.io.File; public class Main { public static File generatePhotoFile(String location) { File photoFile = null; File outputDir = getPhotoDir(); if (outputDir != null) { String photoFileName = location + ".jpg"; photoFile = new File(outputDir, photoFileName); } return photoFile; } public static File getPhotoDir() { File picDirectory = null; File pictureDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); picDirectory = new File(pictureDir, "Jing"); if (!picDirectory.exists()) { if (!picDirectory.mkdirs()) { picDirectory = null; } } return picDirectory; } }