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
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
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... :)
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