Code example for Bitmap

Methods: getHeightgetRowBytes

0
    public static int getBitmapSize(Bitmap bitmap) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
            return bitmap.getByteCount();
        } 
        // Pre HC-MR1 
        return bitmap.getRowBytes() * bitmap.getHeight();
    } 
 
    /** 
     * Check if external storage is built-in or removable. 
     *  
     * @return True if external storage is removable (like an SD card), false 
     *         otherwise. 
     */ 
    @SuppressLint("NewApi") 
    public static boolean isExternalStorageRemovable() { 
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
            return Environment.isExternalStorageRemovable();
        } 
        return true; 
    }