Tickled Pink
Tickled Pink

Reputation: 989

Android: how to manage bitmap size when drawing to different sized screens?

I understand the various dpi resources and flexible layouts to support different resolution and sized screens, but I don't understand how to handle different screens using bitmap drawing directly within a view's onDraw() method.

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

However, when I create a larger screen like a 10" tablet, the graphics are drawn to a small phone-sized region.

What's the correct way to provide higher resolution source images for a larger screen as opopsed to a higher density resolution? Do I have to manually load and scale the bitmaps?

Upvotes: 4

Views: 450

Answers (1)

Eric Nordvik
Eric Nordvik

Reputation: 14746

The reason you get small images on a 10" device is that it most likely is an mdpi device. In addition it is probably a "xlarge" device.

Therefore, 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

Upvotes: 2

Related Questions