Here you can find the source of hasExternalCacheDir()
private static boolean hasExternalCacheDir()
//package com.java2s; //License from project: Apache License import android.os.Build; public class Main { private static boolean hasExternalCacheDir() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO; }//from w w w . jav a 2 s . c om }