16
Manikantan K [email protected] @manikantan_k Multiscreen Development in Android

Developing and Designing Multiscreen Android apps

Embed Size (px)

DESCRIPTION

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.

Citation preview

Page 1: Developing and Designing Multiscreen Android apps

Manikantan K

[email protected]@manikantan_k

Multiscreen Development in Android

Page 2: Developing and Designing Multiscreen Android apps

Introducing DP

DP = Density Independent pixelsAlso 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.

Page 3: Developing and Designing Multiscreen Android apps

Concept of DPsresolution = 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

Page 4: Developing and Designing Multiscreen Android apps

Concept of DPs

With device independence

Without device independence

Page 5: Developing and Designing Multiscreen Android apps

Concept of DPs

Density or dpi = Physical Size / ResolutionBaseline density in Android = 160

DIP or DP = Resolution / ( density / 160 )

Page 6: Developing and Designing Multiscreen Android apps

A little about Density

Galaxy Nexus Nexus 7

4.65” 7”

720x1280 800x1280

316 dpi 216 dpi

Notes1. Higher density/ dpi = more data, more clarity.2. Two devices with same/similar resolution need not have same

physical size and vice versa.

Page 7: Developing and Designing Multiscreen Android apps

Screen sizes & Density buckets

*Only a guideline

Page 8: Developing and Designing Multiscreen Android apps

Designing for phones and tablets

Page 9: Developing and Designing Multiscreen Android apps

Handling different sizes

Explicitly declare in the manifest which screen sizes your application supports

Page 10: Developing and Designing Multiscreen Android apps

Handling different sizes

Provide different layouts for different screen sizes

Page 11: Developing and Designing Multiscreen Android apps

Handling different sizes

Provide different bitmap drawables for different screen densities

Page 12: Developing and Designing Multiscreen Android apps

Handling different sizes

Use qualifiers effectively<resources_name>-<qualifier>

Page 13: Developing and Designing Multiscreen Android apps

Handling different sizes

Some recommendations from Google

Page 14: Developing and Designing Multiscreen Android apps

Tip Preview all screens via IDE

Page 15: Developing and Designing Multiscreen Android apps

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

Page 16: Developing and Designing Multiscreen Android apps

Some resourceshttp://developer.android.com/guide/practices/screens_support.html

http://developer.android.com/design/index.html

http://blog.edwinevans.me/?p=131

http://blogs.captechconsulting.com/blog/steven-byle/understanding-density-independence-android

http://stefan222devel.blogspot.com/2012/10/android-screen-densities-sizes.html

http://developer.android.com/tools/help/draw9patch.html