Java tutorial
//package com.java2s; import android.graphics.Bitmap; import android.os.Build; public class Main { public static int getSize(Bitmap bitmap) { if (bitmap == null) { return 0; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { return bitmap.getByteCount(); } else { return bitmap.getRowBytes() * bitmap.getHeight(); } } }