Java tutorial
//package com.java2s; import android.graphics.Bitmap; public class Main { public static int getByteCount(Bitmap bitmap) { // This approach invokes API Level 1 methods unlike the Bitmap.getBytesCount() one from API level 12. return bitmap != null ? bitmap.getRowBytes() * bitmap.getHeight() : 0; } }