1 / 83

Android Development for Different Screens and Devices

Android Development for Different Screens and Devices. Rohit Ghatol. About Me. Rohit Ghatol Architect @QuickOffice Project Mgr @Synerzip Certified Scrum Master Author “ Beginning PhoneGap ” @Apress Founder TechNext Pune (Pune Developer Community). LinkedIn Profile. Topics.

walden
Télécharger la présentation

Android Development for Different Screens and Devices

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android Development for Different Screens and Devices Rohit Ghatol

  2. About Me Rohit Ghatol • Architect @QuickOffice • Project Mgr @Synerzip • Certified Scrum Master • Author “Beginning PhoneGap” @Apress • Founder TechNext Pune (Pune Developer Community) LinkedIn Profile

  3. Topics • Understanding UI Terms and Concepts • Building for Different Screen Sizes • Building for Different Tablets and Phone • Getting ready for Ice Cream Sandwich • Making your app run on all devices • Reference Material

  4. Diversity on Android Android Devices • Handsets • Tablets • TV

  5. Diversity on Android • Screen • Screen Size (2 inch to 50 inch) • DPI (120 – 320 ) • Optional Hardware (Telephony, Camera, GPS) • User Interaction • Touch, DPAD, Trackball, Keyboard

  6. Making App work for different Screens

  7. UI Terms and Concepts

  8. Screen Size Small Categories Medium Measured in Diagonal Large Extra Large

  9. Screen Density DPI – Dots per inches Categories Low Normal High Extra High

  10. Orientation Portrait Landscape

  11. Density Independent Pixel (dp) 1 dp = 1.5 pixels 1 dp = 1 pixels 160 DPI Screen 240 DPI Screen

  12. Range • xlarge screens are at least 960dp x 720dp • large screens are at least 640dp x 480dp • normal screens are at least 470dp x 320dp • small screens are at least 426dp x 320dp

  13. Density Independence px dp

  14. Building for Different Screen Sizes

  15. <supports-screen>

  16. Screen Compatibility Mode For Android 3.2 and above

  17. Screen Compatibility Mode Stretch to Fill Zoom to Fill For Android 3.2 and above

  18. <supports-screens android:resizeable=["true"| "false"] android:smallScreens=["true" | "false"] android:normalScreens=["true" | "false"] android:largeScreens=["true" | "false"] android:xlargeScreens=["true" | "false"] android:anyDensity=["true" | "false"] android:requiresSmallestWidthDp="integer" android:compatibleWidthLimitDp="integer" android:largestWidthLimitDp="integer"/>

  19. Compatibility Modes android:requiresSmallestWidthDp • Small Width Required for this application to be installed on the given device • Currently Android Market does not use it

  20. Compatibility Modes android:compatibleWidthLimitDp • Small Width supported by the application. • If Smallest Side of Device > compatibleWidthLimitDp, user is offered to run application in Compatibility mode

  21. Compatibility Modes android:largestWidthLimitDpSmall Width supported by the application. • If Smallest Side of Device > largestWidthLimitDp, application is forced run application in Compatibility mode (without any option)

  22. Different Layouts

  23. UI Guidelines • Keep Business logic separate • Keep Views independent • Keep Navigation logic out of Views

  24. < Android 3.1 • layout-small • layout-normal • layout-large • layout-xlarge

  25. >= Android 3.2 • layout-sw600dp • layout-w720dp • layout-h500dp Now you can declare which layout to use at which width and not more vague partitions like layout-small, layout-normal, layout-large and layout-xlarge http://developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts

  26. Different Bitmaps

  27. Drawable-Resolution • drawable • drawble-nodpi – Not Scaled at all • drawable-ldpi ~ 120 dpi (.75x scale) • drawable-mdpi ~ 160 dpi (baseline scale) • drawable-hdpi ~ 240 dpi (1.5x scale) • drawable-xhdpi ~ 320 dpi (2x scale)

  28. Icon GuideLines As of Android 3.0, Options menu has been superseded by Action bar For Android 3.0+

  29. Menu Icons Guidelines For Android 2.3

  30. Status Bar Icons For Android 3.0+

  31. Status Bar Icons For Android 2.3

  32. Nine Patch Images

  33. Nine Patch Images

  34. Shapes XML

  35. Best part is these are Density Independent

  36. MultiResolution App

  37. Config Qualifier

  38. How Android finds best resource?

  39. Available Resources drawable/ drawable-en/ drawable-fr-rCA/ drawable-en-port/ drawable-en-notouch-12key/ drawable-port-ldpi/ drawable-port-notouch-12key/

  40. Device Configuration Locale = en-GB Screen orientation = port Screen pixel density = hdpi Touchscreen type = notouch Primary text input method = 12key

  41. Step 1 Remove Contradictory Entry drawable/ drawable-en/ drawable-fr-rCA/ drawable-en-port/ drawable-en-notouch-12key/ drawable-port-ldpi/ drawable-port-notouch-12key/

  42. Step 2-5 Start Filtering 2 Locale = en-GB Screen orientation = port Screen pixel density = hdpi Touchscreen type = notouch Primary text input method = 12key 8 11 12 14 # Config Precedence order

  43. Step 2- 5 Filter by Language drawable/ drawable-en/ drawable-en-port/ drawable-en-notouch-12key/ drawable-port-ldpi/ drawable-port-notouch-12key/

  44. Step 2-5 Filter by Orientation drawable/ drawable-en/ drawable-en-port/ drawable-en-notouch-12key/ drawable-port-ldpi/ drawable-port-notouch-12key/

  45. Building for Tablets & Handsets

  46. HoneyComb UI New UI Elements • Fragments • Action Bar

More Related