Java tutorial
//package com.java2s; import android.os.Environment; import java.io.File; public class Main { public static File createTemporaryFile(String part, String ext) throws Exception { File tempDir = Environment.getExternalStorageDirectory(); tempDir = new File(tempDir.getAbsolutePath() + "/.temp/"); if (!tempDir.exists()) { tempDir.mkdirs(); } return File.createTempFile(part, ext, tempDir); } }