Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (2014) Creating the Screen Layout Adding a TextView

How about "dp"?

When I type 24 in the textsize and without "sp", it just automatically shows "dp". What is "dp" means?

Lewis Cowles
Lewis Cowles
74,902 Points

you should select Viktor's answer so others know this is answered

1 Answer

DP is density-independent pixels. It corresponds to the physical size of a pixel at 160 dpi.

Thanks a lot~ Viktor Johansson

Lewis Cowles
Lewis Cowles
74,902 Points

https://en.wikipedia.org/wiki/Device_independent_pixel

also

https://teamtreehouse.com/library/build-a-simple-android-app-new/creating-the-screen-layout/setting-padding

BTW ignore Wikipedia's use of the word device, the word density refers to the devices pixel density for high-resolution modern screens