public static int bitmapSize ( Bitmap bitmap ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . KITKAT ) { return bitmap . getByteCount ( ) ; } else { return bitmap . getRowBytes ( ) * bitmap . getHeight ( ) ; } }
Calculating allocated memory for bitmap