Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.Bitmap; import android.os.Build; public class Main { public static long getBitmapSize(Bitmap bitmap) { long size = 0; if (bitmap != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { return bitmap.getByteCount(); } else { // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); } } return size; } }