Main menu Post navigation Scaling images in a way that suits all screen sizes in android It is not a good coding practice to scale a image by specifying its height and width in pixels because on different screen sizes i.e HDPI,LDPI,MDPI etc .Hence ,it is recommended to scale a image  according to the screen dimensions in the following way. The following function is used for scaling bitmap which is a part of  android.graphics.Bitmap Bitmap. createScaledBitmap (Bitmap_image, width, height,true); STEPS: 1.Create a image view object and associate it with its corresponding ImageView in xml file.