I have two images I want to display within my app.
The first image is to be full screen (as a background for the app). I have read the 'Supporting Multiple Screens' article on developers.android.com multiple times but, I am still at a loss as to what size the image should be for each dpi category. I have attempted what I thought to be the correct sizes but, when viewing the app on larger screens (ie. 1280x800@mdpi), I find that the background appears pixelated. This is understandable since my image for mpdi is 320x480px. How can I correct this? What size image should I use?
The second image is a button. Currently I have the image at a very high resolution but, the app scales this down so it looks fine. However, I do not wish for it to be this way when the app is released. For this image, I need to know what size in pixels the image should be. Currently, it is 60dp x 50dp
within the app. What would this convert to in pixels? I know to use the formula px = dp * (dpi / 160)
but, what would the dpi be in this case? I cannot use a NinePatch PNG for this image.
I do not understand what size (in pixels) to make my images to begin with so that they appear correctly on Android devices. Does dp = px if you are on a mdpi device?
UPDATE:
After hours of banging my head around, I have came up with the following:
drawable-xlarge-xhdpi 2560x1920px
drawable-large-xhdpi 1920x1440px
drawable-normal-xhdpi 1280x960px
drawable-xlarge-hdpi 1920x1440px
drawable-large-hdpi 1440x1080px
drawable-normal-hdpi 960x720px
drawable-xlarge-mdpi 1280x960px
drawable-large-mdpi 960x720px
drawable-normal-mdpi 640x480px
drawable-xlarge-ldpi 960x720px
drawable-large-ldpi 720x540px
drawable-normal-ldpi 480x360px
These will be my drawable directories and the maximum resolution I expect for each one (I've decided not to support small screens). Therefore, my images will be these sizes.
It looks great on my phone. I see no artifacts. It also appears to work on the emulator for a screen with 1280x800@mpdi so hopefully it will work on all devices...
Does anyone see a problem with doing it this way? Is there a better way to do this? Do my calculations look correct?