Code example for File

Methods: exists, mkdir

0
			cacheDir = individualDir;
		} 
		return new TotalSizeLimitedDiscCache(cacheDir, 2 * 1024 * 1024); // limit - 2 Mb
	} 
 
	/** 
	 * Creates default implementation of {@link MemoryCacheAware} depends on incoming parameters: <br /> 
	 * {@link LruMemoryCache} (for API >= 9) or {@link LRULimitedMemoryCache} (for API < 9).<br /> 
	 * Default cache size = 1/8 of available app memory. 
	 */ 
	public static MemoryCacheAware<String, Bitmap> createMemoryCache(int memoryCacheSize) {
		if (memoryCacheSize == 0) {
			memoryCacheSize = (int) (Runtime.getRuntime().maxMemory() / 8);
		} 
		MemoryCacheAware<String, Bitmap> memoryCache;
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
			memoryCache = new LruMemoryCache(memoryCacheSize);
		} else { 
			memoryCache = new LRULimitedMemoryCache(memoryCacheSize);
		} 
		return memoryCache;