private static File getCacheDirectory(Context context) {
        File appCacheDir = null;
        if (MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
            appCacheDir = context.getExternalCacheDir();
        }
        if (appCacheDir == null) {
            appCacheDir = context.getCacheDir();
        }
        if (appCacheDir == null) {
            String cacheDirPath = "/data/data/" + context.getPackageName() + "/cache/";
            appCacheDir = new File(cacheDirPath);
        }
        return appCacheDir;
    }
Returns application cache directory. Cache directory will be created on SD card
<i>("/Android/data/[app_package_name]/cache")</i> (if card is mounted and app has appropriate permission) or
on device's file system depending incoming parameters.

@param context        Application context
@return Cache {@link File directory}.<br />
<b>NOTE:</b> Can be null in some unpredictable cases (if SD card is unmounted and
{@link android.content.Context#getCacheDir() Context.getCacheDir()} returns null).
dkplayer-videocache/src/main/java/com/danikula/videocache/StorageUtils.java