public static boolean storeOnApplicationPrivateDir ( Context context , Bitmap bitmap , String filename , Bitmap . CompressFormat format , int quality ) { OutputStream out = null ; try { out = new BufferedOutputStream ( context . openFileOutput ( filename , Context . MODE_PRIVATE ) ) ; return bitmap . compress ( format , quality , out ) ; } catch ( FileNotFoundException e ) { Log . e ( TAG , "no such file for saving bitmap: " , e ) ; return false ; } finally { CloseableUtils . close ( out ) ; } }
Store the bitmap on the application private directory path .