Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is dp the same as dip? [duplicate]

Possible Duplicate:
Difference of px, dp, dip and sp in android

I've found several topics on this. But none really answers my question.

Dp and dip in android. What is the difference? Is it the same thing?

like image 212
johan Avatar asked Sep 30 '11 09:09

johan


People also ask

Is dip and dp the same?

dip is as same as a dp. Using sp/dp will make your Android applications compatible with multiple screen densities and resolutions. Highly active question.

What is dp and dip?

The terms DP and DIP refer to Density Independent Pixels, which are based on the physical density of the screen. SP: Similar to dp, but also scaled by the user's font size selection. When choosing font sizes, it is recommended that you use this unit so that they are adjusted for both screen density and user choice.

Is dp the same as PX?

The conversion of dp units to screen pixels is simple: px = dp * (dpi / 160). For example, on a 240 dpi screen, 1 dp equals 1.5 physical pixels. You should always use dp units when defining your application's UI, to ensure proper display of your UI on screens with different densities.

What does dp and SP mean?

Commonly used as light switches in your household, all electrical switches can practically turn on and off any electronic device. We categorise switches as single-pole (SP) or double pole (DP) switches based on their working mechanism and functionality.


1 Answers

Yes, they are the same. There is no difference, its just an alias.

Documentation:

The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp".

like image 80
WarrenFaith Avatar answered Oct 02 '22 05:10

WarrenFaith