Android displays a different image at different resolutions

I am trying to create a very graphically intensive Android app. Almost the entire user interface is based on bitmaps, and I would like to support as many different devices as possible, and make the application look great in all of them.

Is it possible to embed different resolutions for each image and have a different image displayed on each device. I know that things like hdpi folders etc. also have units like dip etc. etc. But it still leaves too many variables as to how the image is displayed. I would like the images not to scale at all so as not to lose image quality.

For example, on my device with a high resolution, I would like the image to be exactly 100 pixels, and then on the device with a medium resolution I would like the image with a lower resolution to display exactly 80 pixels. If I use display-independent units, I cannot guarantee that the images will be of a certain size.

Anyone have any ideas or suggestions on how to do this?

+4
source share
1 answer

Use a combination of dpi (hdpi, etc.) and orientation (ground / port) to make resources as possible on different screens as possible.

In addition, your ImageView specifies android: scaleType = "fitCenter" or android: scaleType = "centerCrop" to accommodate custom resolutions.

+1
source

All Articles