Create your account

Already have an account? Login here

Create account

26. What is Dp, Sp, Px in Android?

Design + Code an Android App from Scratch

Woah, wait a second..

Scrounge up some loose change to become a pro member, or login to your account to view this lesson.

Alright, join now. Or login to your account if you're already a pro member.

This video explains the units of measurements in Android. It takes a simple Image to illustrate that pixels cannot be used to specify sizes in Android has different Android devices can fit different number of pixels on screen. The idea also called screen density determines how crisp an Android screen can be. A screen with higher density takes lesser space to display the same content whereas its the opposite for screens with lower density values. Pixels, Millimetres, Inches, Points, Density Independent Pixels, Scaled Pixels are some of the units of measurement in Android. Every device having its own density, you often target a range of devices with a particular density instead of specific values. These range values are called density buckets. Finally the video illustrates the difference between sp and dp and shows why sp is to be used for font sizes.

Course Cirriculum