androidandroid-layoutscreen-sizescreen-density

Android Configuring For multiple Screen Densities


I am having trouble configuring my Android application for another screen density. Currently, my app runs on HDPI (1.5) screens and I am trying to get the dimensions of my pngs and my values in my dimension.xml to be compatible with XHDPI (2.0) screens.

For example, my background png is currently 1280px x 800px and it works well with my HDPI (1.5) screen. I assumed this would mean that I would need a 1280 * (4/3) = 1706.67px by 800 * (4/3) = 1066.67px dimension png. This did not show the same as my current tablet.

Also, my screens are almost exactly the same size


Solution

  • If you have an image 1000X1000 (pixels) you have to create the following versions of the image:

    Except, in @dimension, HAS NOT put some values "dp" or "sp" and then used them in the style of the image.