28
Apr
Apr
Android Units - Difference between Screen Measuring Units
28 Apr
Posted by Mihai mobile development/ android/ screen resolutions
Measuring units. You'd think there's just one. Well, think again!
Here's a list showing you all of them:
- in
Full Name: inches
Description: Takes into consideration the physical screen of the device
- dp || dpi
Full Name: Density Independent Pixel
Description: An abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion.
- sp || sip
Full Name: Scale-independent Pixels
Description: This is like the dp unit, but it is also scaled by the user's font size preference.
- px
Full Name: Pixels
Description: Corresponds to actual pixels on the screen.
- mm
Full Name: Millimeters
Description: Related with the physical size of the screen.
- pt
Full Name: Points
Description: 1/72 of an inch based on the physical size of the screen.
Here's an image to understand more about the units.

With this in mind, Android has a set of six generalized densities:
- ldpi (low) ~120dpi
- mdpi (medium) ~160dpi
- hdpi (high) ~240dpi
- xhdpi (extra-high) ~320dpi
- xxhdpi (extra-extra-high) ~480dpi
- xxxhdpi (extra-extra-extra-high) ~640dpi
What's in it for me? You may ask. Just remember this if you're developing on Android: Use dp for layout and sp for fonts.
Now you're all set, have fun.
Here's a list showing you all of them:
- in
Full Name: inches
Description: Takes into consideration the physical screen of the device
- dp || dpi
Full Name: Density Independent Pixel
Description: An abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion.
- sp || sip
Full Name: Scale-independent Pixels
Description: This is like the dp unit, but it is also scaled by the user's font size preference.
- px
Full Name: Pixels
Description: Corresponds to actual pixels on the screen.
- mm
Full Name: Millimeters
Description: Related with the physical size of the screen.
- pt
Full Name: Points
Description: 1/72 of an inch based on the physical size of the screen.
Here's an image to understand more about the units.

With this in mind, Android has a set of six generalized densities:
- ldpi (low) ~120dpi
- mdpi (medium) ~160dpi
- hdpi (high) ~240dpi
- xhdpi (extra-high) ~320dpi
- xxhdpi (extra-extra-high) ~480dpi
- xxxhdpi (extra-extra-extra-high) ~640dpi
What's in it for me? You may ask. Just remember this if you're developing on Android: Use dp for layout and sp for fonts.
Now you're all set, have fun.
Category View
Tags
activities
Aggregation
amazon
android
apache
API
appcelerator
application
assistant manager
backup
balance
brand recognition
business days
cache
camp
coding standards
command
commerce
community
context
cURL
customer engagement
customer portal
database
data integrity
deployment
developer
Drupal
drupal 7
drupal 8
Drupal Camp
Drupal Core
Drupal development
Drupal solution
Drush
e-commerce
events
filter
front-end developer
game
games
general
git
Global Training
google maps
integration
ios
job
Job fairs
jobs
kpi
maintenance
manual testing
memcache
mobile
mobile app
mobile application
mobile development
Module
modules
mysql
open source
Panels
performance
php
php developer
plans
project
project manager
promotion
qa
Quality Assurance
redis
registry
Relation
release candidate
remote team
responsibilities
responsive
screen resolutions
Scrum
Security
server
Services
session
skills
software
software testing
sprint
stock management system
studio
support
Targul de Cariere
team
team building
teambuilding
teamwork
testing
titanium
tutorial
Târgul de Cariere in IT
Unit Testing
update
Updates
usability
user experience
varnish
Views
Views Handler
web application
web application testing
web development
webservice
webshop
website usability