Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; import android.content.Context; public class Main { public static File getTempFile(Context context, String fileName) { File file = null; try { file = File.createTempFile(fileName, null, context.getCacheDir()); } catch (IOException e) { e.printStackTrace(); } return file; } }