Java tutorial
//package com.java2s; import android.graphics.Bitmap; public class Main { public static Bitmap getImageThumbnail(Bitmap input) { int desiredWidth = 500; Float width = new Float(input.getWidth()); Float height = new Float(input.getHeight()); Float ratio = width / height; return Bitmap.createScaledBitmap(input, (int) (desiredWidth * ratio), desiredWidth, false); } }