Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As the others have suggested, the Android online documentation has great articles on this. However, I'm going to try and list here some quick and helpful tips:</p> <ol> <li>Consider MDPI is <code>1</code>. Then, LDPI is <code>0.75</code> and HDPI is <code>1.5</code>. What that means is that if you have a drawable that is, say, <code>50x50</code> on a MDPI screen it will have to be <code>~37x37</code> on a LDPI screen and <code>75x75</code> on a HDPI screen, <strong>in order to appear at roughly the same physical size</strong> on each screen (i.e. 2cm if you put a ruler on the screen). Also, your computer screen is <em>most probably</em> MDPI, which is why it's recommended to start with MDPI drawables and then resize them: the <strong>physical size</strong> of the drawable will be very close between your computer screen and an MDPI Android device. If you view an HDPI drawable on your computer and on an HDPI device you will notice that it's <strong>much</strong> bigger (again, <strong>physically</strong> -- put a ruler on it style) on the PC screen.</li> <li>If you do not supply special drawables for each density, Android will scale the closest one available automatically.</li> <li>You should not consider the DPI of a device to have anything to do with screen size and/or number of pixels and/or resolution and/or aspect ratio. A device could be very small and have an HDPI screen or very large and have an LDPI screen. The whole point of this density-differentiation is to have things <strong>look the same size</strong> on all devices, <strong>not</strong> fit the same on all devices. For example, if a drawable fills the whole screen on one MDPI device do not expect it to do the same on another MDPI device. Also, do not expect to "see the same thing" on different DPI devices. Most HDPI devices actually have <strong>more</strong> space than lower DPI devices. For example, if a <code>ListView</code> can show 5 items on a MDPI device it might be able to show 6 items on an HDPI device, in spite of the fact that the <code>ListView</code> items have the same density-independent (i.e. 1.5 times larger on HDPI than on MDPI) height.</li> </ol> <p>I might have gone a bit offtopic, but these are things I have learned in time by banging my head against them. Just trying to save someone else's headache :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload