Code example for Context

Methods: getExternalCacheDirgetPackageName

0
	 */ 
	@SuppressLint("NewApi") 
	private static String getExternalCacheDir(Context context) {
		// android 2.2 以后才支持的特性 
		if (hasExternalCacheDir()) { 
			return context.getExternalCacheDir().getPath() + File.separator
					+ "request"; 
		} 
 
		// Before Froyo we need to construct the external cache dir ourselves 
		// 2.2以前我们需要自己构造 
		final String cacheDir = "/Android/data/" + context.getPackageName()
				+ "/cache/request/"; 
		return Environment.getExternalStorageDirectory().getPath() + cacheDir;
	} 
 
	private static boolean hasExternalCacheDir() { 
		return Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO;
	} 
 
	private static String getCacheRequest(Context context, String requestUrl,