0

I am trying to understand the "Best practices for Screen Independence". Can someone explain me when to use and when not to use the DP and PX measures ? (of course it is in documentation but my understanding is little vague from it..)

Thanks

poddroid
  • 845
  • 1
  • 14
  • 26
  • 1
    Duplicate of http://stackoverflow.com/questions/2025282/difference-of-px-dp-dip-and-sp-in-android – mgv Apr 12 '11 at 14:35
  • Sorry... I would have checked it first... I got my answer from the above link... Thanks @mgv – poddroid Apr 12 '11 at 15:37

3 Answers3

0

You should always use dp as the format of any height and width of the View. If you want more help to measure the dp and px of the particular resolution then..

see this Link: LINK which helps you to measure the px for the different resolution.

Enjoy Coding... :)

Shreyash Mahajan
  • 23,386
  • 35
  • 116
  • 188
0

I tend to use DP at all times. Avoid PX like the plague.

Twobard
  • 2,553
  • 1
  • 24
  • 27
0

Have you read Supporting Multiple Screens? Essentially, if you want to scale to keep the same relative size on different screens, use DP; if you want to shrink on larger displays (and grow on smaller ones), use PX.

Hope this helps,

Phil Lello

Phil Lello
  • 8,377
  • 2
  • 25
  • 34