SlideShare a Scribd company logo
Dealing with Different
          Devices


               
Objective: Minimal Redundancy
    ●   More code = more cost
        –   More development time initially
        –   Greater odds of bugs
        –   More maintenance over time
    ●   Aim for maximum targets with the least
        feasible code


                                    
Step #1: Identify Targets
    ●   Where Is Your App Really Going to be Used?
        –   Outside of US? Small screens popular
        –   Heavily dependent on mobile data? Tablets less
            likely, TVs pretty much out
    ●   Business-Focused Restrictions
        –   Distribution partners (e.g., OEM deals)
        –   Enterprise requirements

                                   
Step #2: High-Level UX Design
    ●   What Are the Major Functions?
        –   E.g., Gmail = labels, conversations, messages,
            composition
    ●   How Are the Functions Delivered?
        –   E.g., Gmail = one per screen on phones,
            combined on tablets
    ●   What Functional Differences Are There?
        –   E.g., something only on tablets
                                   
Step #3: ID Reusable Portions
    ●   Where Are You Combining Things?
        –   Tablet screen = combination of multiple phone
            screens
        –   Only min0r differences in functionality, look and
            feel




                                   
Step #4: Apply Fragments
    ●   Fragments in an MVC World
        –   Models = POJOs, database+helper, whatever
        –   Views = widgets
        –   Controller = fragments
        –   Activities = orchestration




                                   
Step #4: Apply Fragments
              Activity A                 Activity C

Tablet
              1        2                     3




          Activity A       Activity B    Activity C


    TV        1                   2          3




                               
Step #4: Apply Fragments
    ●   Orchestration via Listeners
        –   Define interface for the event listener
        –   Activity supplies implementation to fragment
        –   Fragment calls listener methods as needed
        –   Activity responds
             ●   Dynamic fragment or reconfigure existing
                 fragment
             ●   Start an activity
                                       
Step #4: Apply Fragments
    ●   Hoped-For Outcomes
        –   Fragments directly usable in all screen sizes
             ●   1 per activity in small/normal screens
             ●   1+ per activity in large/xlarge screens
             ●   Fragment implementations oblivious to where other
                 fragments reside
        –   Views and models unaffected


                                         
Step #5: Tactical Considerations
    ●   Use density-independent dimensions
    ●   Use stretchable graphics
        –   ShapeDrawable
        –   Nine-patch PNGs
        –   SVG (via add-on library)




                                   
Step #5: Tactical Considerations
    ●   Tell Android where whitespace goes
        –   LinearLayout and android:layout_weight
        –   TableLayout and android:stretchColumns
        –   RelativeLayout and wise choice of rules
             ●   Get graphics designer to design with rules in mind!




                                        
Step #5: Tactical Considerations
    ●   Resource Set Strategy
        –   Drawables by Density
             ●   Want image to stay roughly the same size
        –   Layout by Screen Size
             ●   Apply appropriate fragments, sized and positioned
                 as needed
        –   Values by Density (dimensions)
        –   New in 3.2: minimum resolution resource sets
                                       
Step #5: Tactical Considerations
    ●   API Versions and Backwards Compatibility
        –   Class Detection
        –   Reflection
        –   Conditional Class Loading
             ●   Newer API only
             ●   Abstract class and multiple API concrete
                 implementations
        –   Why? For other tablet features
 
             ●   E.g., work with action  bar
Step #6: Testing
    ●   Emulators
    ●   Devices
        –   Owned
        –   Loaned (e.g., user group events, device labs at
            conferences)
        –   DeviceAnywhere and similar services
        –   Controlled beta test release

                                   
Alternative #1: Market Filtering
    ●   Upload Multiple APKs
        –   Each targeting a different device spec
    ●   Apply Market Filters
        –   APKs only delivered to devices on which it
            should work




                                   
Alternative #2: Manifest Filtering
    ●   <compatible-screens>
    ●   <supports-screens>
    ●   <uses-configuration>
    ●   <uses-feature>
    ●   <uses-sdk>



                                
Alternative #3: HTML5
    ●   Detect window size or user agent, use
        appropriate formatting
        –   Screen density can be a challenge
    ●   Use PhoneGap to convert into installable APK
    ●   Bonus: cross-platform
    ●   Cons: limited device integration, “non-native”
        feel
                                  

More Related Content

PDF
Computers and Networking
PPSX
Computer fundamentals
PPT
Operating System Overview.
PPTX
5 PEN PC TECHNOLOGY with GEN OF Computers
PPS
Introduction To Windows Movie Maker
PPTX
Operating system introduction to operating system
PDF
Android UI Design Tips
PDF
Ux Meets Code Interaction Usability
Computers and Networking
Computer fundamentals
Operating System Overview.
5 PEN PC TECHNOLOGY with GEN OF Computers
Introduction To Windows Movie Maker
Operating system introduction to operating system
Android UI Design Tips
Ux Meets Code Interaction Usability

Similar to Android: Dealing with Different Devices (20)

PDF
Phone for me, Tablet for we-Indic Threads Mobile Conf 2011
PPT
Phone for Me, Tablet for We: Building a multi screen app in One Hour
PPTX
Android design patterns in mobile application development presentation
KEY
Min Ahmed - Can help to build a successful mobile application
PDF
Design concepts for Mobile Learnng
PDF
Android design patterns
PPTX
Adaptive UI for Android and iOS using Material and Cupertino.pptx
PPTX
(Android) Developer Survival in Multiscreen World, MobCon Sofia 2016
PDF
Create great UIs for budget phones
PDF
Іван Дульнявка “Розробка UI для мобільних платформ”
PDF
Excellence in the Android User Experience
PPT
Android UI Patterns
PPTX
User experience and interactions design
PPT
Designing for the mobile form factor
KEY
10 Design Commandments for Mobile App Developers
PDF
Top Tips for Android UIs - Getting the Magic on Tablets
PPTX
Building Large Sustainable Apps
PPT
Android ui patterns
PPT
Android ui patterns
PPTX
Designing For Android
Phone for me, Tablet for we-Indic Threads Mobile Conf 2011
Phone for Me, Tablet for We: Building a multi screen app in One Hour
Android design patterns in mobile application development presentation
Min Ahmed - Can help to build a successful mobile application
Design concepts for Mobile Learnng
Android design patterns
Adaptive UI for Android and iOS using Material and Cupertino.pptx
(Android) Developer Survival in Multiscreen World, MobCon Sofia 2016
Create great UIs for budget phones
Іван Дульнявка “Розробка UI для мобільних платформ”
Excellence in the Android User Experience
Android UI Patterns
User experience and interactions design
Designing for the mobile form factor
10 Design Commandments for Mobile App Developers
Top Tips for Android UIs - Getting the Magic on Tablets
Building Large Sustainable Apps
Android ui patterns
Android ui patterns
Designing For Android
Ad

More from CommonsWare (20)

PDF
Gradle and Your Android Wearable Projects
PDF
Getting Android Developers for Your Wearables
PDF
When Microwatts Are Precious: Battery Tips for Wearable Apps
PDF
The Action Bar: Front to Back
PDF
Android Security: Defending Your Users
PDF
Secondary Screen Support Using DisplayManager
PDF
Mastering the Master Detail Pattern
PDF
Not Quite As Painful Threading
PDF
Android Development: The 20,000-Foot View
PDF
Maps V2... And You!
PDF
A Deep Dive Into ViewPager
PDF
Second-Screen Support in Android 4.2
PDF
Integrate Android Apps and Web Apps
PDF
From Android to the Mobile Web
PDF
X Means Y
PDF
The Wonderful World of Wearables
PDF
Securing User Data with SQLCipher
PDF
Beaming Data to Devices with NFC
PDF
What's New in Jelly Bean
PDF
Making Money at Mobile: 60 Business Models
Gradle and Your Android Wearable Projects
Getting Android Developers for Your Wearables
When Microwatts Are Precious: Battery Tips for Wearable Apps
The Action Bar: Front to Back
Android Security: Defending Your Users
Secondary Screen Support Using DisplayManager
Mastering the Master Detail Pattern
Not Quite As Painful Threading
Android Development: The 20,000-Foot View
Maps V2... And You!
A Deep Dive Into ViewPager
Second-Screen Support in Android 4.2
Integrate Android Apps and Web Apps
From Android to the Mobile Web
X Means Y
The Wonderful World of Wearables
Securing User Data with SQLCipher
Beaming Data to Devices with NFC
What's New in Jelly Bean
Making Money at Mobile: 60 Business Models
Ad

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Big Data Technologies - Introduction.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
cuic standard and advanced reporting.pdf
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Empathic Computing: Creating Shared Understanding
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Big Data Technologies - Introduction.pptx
20250228 LYD VKU AI Blended-Learning.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Digital-Transformation-Roadmap-for-Companies.pptx
Understanding_Digital_Forensics_Presentation.pptx
Modernizing your data center with Dell and AMD
cuic standard and advanced reporting.pdf
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Machine learning based COVID-19 study performance prediction
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Network Security Unit 5.pdf for BCA BBA.
Empathic Computing: Creating Shared Understanding
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Monthly Chronicles - July 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?

Android: Dealing with Different Devices

  • 1. Dealing with Different Devices    
  • 2. Objective: Minimal Redundancy ● More code = more cost – More development time initially – Greater odds of bugs – More maintenance over time ● Aim for maximum targets with the least feasible code    
  • 3. Step #1: Identify Targets ● Where Is Your App Really Going to be Used? – Outside of US? Small screens popular – Heavily dependent on mobile data? Tablets less likely, TVs pretty much out ● Business-Focused Restrictions – Distribution partners (e.g., OEM deals) – Enterprise requirements    
  • 4. Step #2: High-Level UX Design ● What Are the Major Functions? – E.g., Gmail = labels, conversations, messages, composition ● How Are the Functions Delivered? – E.g., Gmail = one per screen on phones, combined on tablets ● What Functional Differences Are There? – E.g., something only on tablets    
  • 5. Step #3: ID Reusable Portions ● Where Are You Combining Things? – Tablet screen = combination of multiple phone screens – Only min0r differences in functionality, look and feel    
  • 6. Step #4: Apply Fragments ● Fragments in an MVC World – Models = POJOs, database+helper, whatever – Views = widgets – Controller = fragments – Activities = orchestration    
  • 7. Step #4: Apply Fragments Activity A  Activity C Tablet 1 2 3 Activity A Activity B  Activity C TV 1 2 3    
  • 8. Step #4: Apply Fragments ● Orchestration via Listeners – Define interface for the event listener – Activity supplies implementation to fragment – Fragment calls listener methods as needed – Activity responds ● Dynamic fragment or reconfigure existing fragment ● Start an activity    
  • 9. Step #4: Apply Fragments ● Hoped-For Outcomes – Fragments directly usable in all screen sizes ● 1 per activity in small/normal screens ● 1+ per activity in large/xlarge screens ● Fragment implementations oblivious to where other fragments reside – Views and models unaffected    
  • 10. Step #5: Tactical Considerations ● Use density-independent dimensions ● Use stretchable graphics – ShapeDrawable – Nine-patch PNGs – SVG (via add-on library)    
  • 11. Step #5: Tactical Considerations ● Tell Android where whitespace goes – LinearLayout and android:layout_weight – TableLayout and android:stretchColumns – RelativeLayout and wise choice of rules ● Get graphics designer to design with rules in mind!    
  • 12. Step #5: Tactical Considerations ● Resource Set Strategy – Drawables by Density ● Want image to stay roughly the same size – Layout by Screen Size ● Apply appropriate fragments, sized and positioned as needed – Values by Density (dimensions) – New in 3.2: minimum resolution resource sets    
  • 13. Step #5: Tactical Considerations ● API Versions and Backwards Compatibility – Class Detection – Reflection – Conditional Class Loading ● Newer API only ● Abstract class and multiple API concrete implementations – Why? For other tablet features   ● E.g., work with action  bar
  • 14. Step #6: Testing ● Emulators ● Devices – Owned – Loaned (e.g., user group events, device labs at conferences) – DeviceAnywhere and similar services – Controlled beta test release    
  • 15. Alternative #1: Market Filtering ● Upload Multiple APKs – Each targeting a different device spec ● Apply Market Filters – APKs only delivered to devices on which it should work    
  • 16. Alternative #2: Manifest Filtering ● <compatible-screens> ● <supports-screens> ● <uses-configuration> ● <uses-feature> ● <uses-sdk>    
  • 17. Alternative #3: HTML5 ● Detect window size or user agent, use appropriate formatting – Screen density can be a challenge ● Use PhoneGap to convert into installable APK ● Bonus: cross-platform ● Cons: limited device integration, “non-native” feel