Java tutorial
//package com.java2s; import android.content.Context; import java.io.File; public class Main { private static final String AMAZON_CACHE = "amazon_cache"; static File createDefaultCacheDir(Context context) { final File cache = new File(context.getApplicationContext().getCacheDir(), AMAZON_CACHE); if (!cache.exists()) { //noinspection ResultOfMethodCallIgnored cache.mkdirs(); } return cache; } }