Code example for ContextWrapper

Methods: getDir

import android.util.Log; 
public class CacheInternalStorage { 
	public static void cache(String imageUrl, Context ctx){
		ContextWrapper cw = new ContextWrapper(ctx);
		File directory = cw.getDir("OohlalaCache", Context.MODE_PRIVATE);
		File mypath = new File(directory, RetrieveData.hash(imageUrl) + ".png");
		FileOutputStream fos = null;
	    try { 
	        fos = new FileOutputStream(mypath);
	        // Use the compress method on the BitMap object to write image to the OutputStream 
	        Bitmap bitmap = decodeBitmapFromInputStream(imageUrl);
	        if (bitmap != null){
	        	//new BitmapCompress(bitmap, fos).execute(); 
	            bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
            	bitmap = null;