Java tutorial
//package com.java2s; import android.content.Context; import java.io.File; public class Main { private static final String DISK_CACHE_SUBDIR = "thumbnails"; public static File getDiskCacheFile(Context context, String key) { final String cachePath = context.getFilesDir().getPath(); File cacheDir = new File(cachePath + File.separator + DISK_CACHE_SUBDIR); if (!cacheDir.exists()) { cacheDir.mkdir(); } return new File(cacheDir + File.separator + key); } }