A presentation to remind developers and designers the important points to consider while developing Android apps that work on different form factors, including phones and tablets. It also covers the concept of DPs.
2. Introducing DP
DP = Density Independent pixels
Also called DIP
•Introduced to declare and create UIs that are screen
size/resolution independent.
•Helps to ensure interfaces work well across devices of
different aspect ratio/ screen density etc.
•In Android, refrain from using px for width/distance and
other measurements. Always use DP.
3. Concept of DPs
resolution = number of pixels available in the display
density = how many pixels appear within a constant area
of the display, dots per inch = dpi
size = amount of physical space available for displaying
an interface, screen's diagonal, inch
density-independent pixel = virtual pixel that is
independent of the screen density, dp
5. Concept of DPs
Density or dpi = Physical Size / Resolution
Baseline density in Android = 160
DIP or DP = Resolution / ( density / 160 )
6. A little about Density
Galaxy Nexus
4.65”
800x1280
316 dpi
1.
2.
7”
720x1280
Notes
Nexus 7
216 dpi
Higher density/ dpi = more data, more clarity.
Two devices with same/similar resolution need not have same
physical size and vice versa.
15. Handling different sizes
Using 9-patch images helps you scale a graphic without
distortion.
Use 9 patch images for BG of Buttons, EditText etc
9-patch tool comes as a part of the Android SDK