Android: how to control the size of a bitmap when drawing on screens of different sizes?

I understand the various dpi resources and flexible layouts to support different resolution and size screens, but I don’t understand how to handle different screens using a bitmap drawing directly in the viewDraw () method.

I have an application that draws moving bitmaps to be touched. It has been developed so far on a 480x320 screen, and test graphics have been created in this resolution. To support alternative screens, such as emulated WVGA, I have successfully placed high resolution images in the hdpi folder and it works.

However, when I create a larger screen, such as a 10-inch tablet, the graphics are drawn in the small size of the phone.

What is the correct way to provide higher resolution images for a larger screen as described with a higher density resolution? Do I need to manually load and scale bitmaps?

+4
source share
1 answer

The reason you get small images on a 10-inch device is because it is most likely an mdpi device. Also, it is probably the "xlarge" device.

So try putting the graphics for such devices in a folder called

drawable-xlarge-mdpi 

See this for reference: http://developer.android.com/guide/practices/screens_support.html

+2
source

All Articles