Hallo,
I am writing a widget, but am unsure what size bitmap to use as a background for each screen resolution/density.
According to the Android Developer App Widgets tutorial:
To find your minimum width and height in density-independent pixels (dp), use this formula:
(number of cells * 74) - 2
Following this formula, you should use 72 dp for a height of one cell, 294 dp and for a width of four cells
So if my widget is 72dp x 294dp, what size bitmaps do I need for my ldpi, mdpi and hdpi drawables?
Also, will I need any particular supports-screens settings in my manifest?
TIA,
-Frink
Update: I've made some checkerboard patterns in various sizes and colours for each drawable- folder and tried them out. Is this density thing a bit of a red herring?
I've just done a screen-grab of my emulator running as HVGA, medium density, 320x480. The size taken up by my widget is 320x100, so I create a 320x100 bitmap in the mdpi folder as a background for my widget it looks perfect both on my emulator and LG GT540.
And for an emulator running as WVGA854, high density, 480x854. The size of my widget is 480x150. Creating a background this size and placing it in the hdpi folder displays correctly on this emulator. I have no hardware to test this on tho :-(
Update2: I think I can explain my problem better now :-)
If I have three devices:
Device1, resolution 320x480, density ldpi
Device2, resolution 320x480, density mdpi
Device3, resolution 400x854, density mdpi
The physical size of the screens would probably all be different, but I don't think the actual sizes matter
I've worked out that Device1 and Device2 will need a background of 320x100, whereas Device3 will need 400x150 So what size background goes into the mdpi folder to display properly on Device2 and Device3?