SlideShare a Scribd company logo
Beating Android Fragmentation
Here be Dragons
Why it’s Scary
That’s a big number.
Know Thy Enemy
• Android OSVersions
• Device DisplayVariations
• Hardware Configurations
The Landscape
The Landscape
• Over 40% of devices in the wild are running Gingerbread! (Android
version 2.3.x,API level 8)
• "Modern" Android OS versions (Honeycomb and higher) are < 50%
of the market.
• Thus, in order to reach all potential users in your market, you must
deal with OS fragmentation.
Basic Defense
• Set targetSdk to the current highest API level.
• Use helper classes to encapsulate OS version checking logic.
Reflection will not work. But you can check
Build.VERSION.SdkInt
• Optionally set minSdk to the lower bound of Android API level
your app supports.
• It is possible to have multiple APKs in Google Play that support
different Android API levels.
Rdio’s Android Landscape
Rdio’s Long Tail
77%
23%
Total Android Users
Top 10 Devices The Rest
Rdio Device Distribution
31%
67%
2%
Devices with over 1,000 users
Devices with > 1 and < 1,000 users
Devices with 1 user
Rdio’s Long-tail (is long)
• 2866 unique devices per month (as determined by Build.Product,
Build.Model)
• Top 10 devices represent 23% of all users
• 255 devices represent 85% of all users
• 894 devices had exactly (one) user
How Did We Get This Data?
• Not from Google Play.
• Even a simple means of identifying the device types and Android
versions running your app/service will prove invaluable.
• Embedding the Build.Model, Build.Product,
Build.VERSION.SdkInt into the User-Agent header, for
example.
• A service that pings an API endpoint every 24 hours. (The example
app has an implementation of this method).
Be Cautious
• The product and model strings can be too granular sometimes.
• Many devices with the same street name have multiple model and
product strings.
• The Samsung Galaxy S III has at least 5 unique model strings.
PickYour Battles
• Use data to drive your development focus.
• Make smart decisions on where you cut off support.
• It is _possible_ to support all the way down to Android 1.6, but is
it worth it?
• Focus on device-specific issues that a lot of your users have.
Device DisplayVariations
Device DisplayVariations
• Display dimensions
• Display density (dpi)
• Display quality
• Don’t try to collect
them all.
• Use SDK tools to help
during design
Tools
• Android support library:Adds support for certain features (such as
Fragments) all the way back to Donut (1.6).
• ActionBar Sherlock:An open source library that adds support for
ActionBar to all versions of Android. http://actionbarsherlock.com
• android-ui-utils: https://code.google.com/p/android-ui-utils/
Use Fragments!
• Activities are heavy, Fragments are light.
• Allow for more flexible UI design and runtime configuration.
Think in Points, not Pixels
• You can’t make a pixel perfect implementation, so don’t try.
• A point is a logical representation of a pixel, based on the actual size
of a pixel on a 160dpi display.
• When designing start with the baseline (160dpi), and extrapolate
upwards. At this density 1pt == 1px (roughly).
Think in Points, not Pixels
• 9-patch is your friend. If your designers aren’t using 9-patch, make
them. There is an excellent 9-patch tool that ships with the Android
SDK (draw9patch).
• 9-patch images are specially formatted PNGs that define what areas
can and cannot be stretched.
draw9patch
Design for Android
• Don’t just take a design made for iOS and shoehorn it into Android.
• Use Android UI idioms:ActionBar, long-press, support landscape
orientation whenever possible, etc.
• RTFM! Google provides some excellent resources on how to design
and develop apps to support different display types.
Level-upYour Layout!
• Two easy, and often overlooked, resources are dimens.xml, and
integers.xml.
• Use Android’s resource directory structure to include multiple
versions (as with any resource). Layout-land, Layout-large, etc.
• For example, define number of columns in a grid view in
integers.xml so different values will be used depending on screen
size and orientation (in lieu of using auto_fit).
integers.xml example
dimens.xml example
Level-upYour Layout!
• Use layout aliases: Define your different layouts (single_pane.xml,
dual_pane.xml, etc) in Resource/Layout, and provide mappings in the
size-qualified values directories (Resource/Values-large, etc).
• This saves you from having duplicate layouts residing in different
Layout directories (i.e. Layout-large/ and Layout-sw600dp/).
Don’t Forget About Focused State
• When designing buttons, or any other clickable/tappable widget,
don’t forget to supply a focused state.
• Without the focused state, the pointing device becomes useless as
the user will have no visual feedback to indicate which control has
focus and will be activated on click.
•<item android:state_focused="true"
android:drawable="@drawable/button_focused" />
Hardware Fragmentation
• May not be an issue depending on your application’s domain.
• Use your manifest to inform Google Play of your hardware
requirements (requires camera, etc).
• Use available APIs to determine fallback action at runtime if optional
peripheral is not available. Such as SensorManager.
External Storage
• Not always external or removable
• Never use a hardcoded path! /sdcard is wrong, wrong, wrong.
• Environment.ExternalDirectory can return a path to internal
storage.
• Store vital application data on internal storage (sqlite database, etc).
Media Framework
• OEMs use many different vendors for their media hardware needs.
• OEMs don’t always or can’t use the default Android MediaPlayer
implementation.
• This means the MediaPlayer can behave in insane ways.
How Rdio Mitigates Device Issues
• Trial and Error (and sometimes luck).
• Beta users group.
• Send one-off test builds to affected users.
• Remote device laboratories such as DeviceAnywhere and Perfecto
Mobile.
Conclusion
• You have no choice, you will encounter fragmentation.
• Be pragmatic, choose your battles, and use usage data to backup
your decisions on where to focus resources.
• Design for Android! Android is not iOS,Android users are not iOS
users, make an app that Android users will like.
Thanks!
• There are 4 of us from Rdio at Evolve (Anthony, Eric, Patrick, and
myself), if you see us, say hi!
• Brett Duncavage, Rdio Android Lead
• @xforward, http://brett.duncavage.org
• Source for example available here: https://github.com/bduncavage/
evolve2013
Biblography
• Android OSVersion Distribution: http://developer.android.com/
about/dashboards/index.html
• Android Designing for Multiple Screens: http://
developer.android.com/training/multiscreen/index.html
• ActionBar Sherlock: http://actionbarsherlock.com
• android-ui-utils: https://code.google.com/p/android-ui-utils/
THANKYOU

More Related Content

Similar to Beating Android Fragmentation, Brett Duncavage

Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA
NITIN GUPTA
 
18th android intro
18th android intro18th android intro
18th android intro
Rahulpreet Singh
 
18th android intro
18th android intro18th android intro
18th android intro
Rahulpreet Singh
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming BasicDuy Do Phan
 
Mobile Application Development powerpoint
Mobile Application Development powerpointMobile Application Development powerpoint
Mobile Application Development powerpoint
JohnLagman3
 
Android webinar class_1
Android webinar class_1Android webinar class_1
Android webinar class_1Edureka!
 
Android based os
Android based osAndroid based os
Android based os
Robinson Johnwilson
 
Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdf
NomanKhan869872
 
Android ppt
Android pptAndroid ppt
Android Applications
Android ApplicationsAndroid Applications
Android Applications
Nazeer Hussain University
 
Developing for Android-Types of Android Application
Developing for Android-Types of Android ApplicationDeveloping for Android-Types of Android Application
Developing for Android-Types of Android Application
Nandini Prabhu
 
Android dev tips
Android dev tipsAndroid dev tips
Android dev tips
Kanda Runapongsa Saikaew
 
Android app development
Android app developmentAndroid app development
Android app development
Abhishek Saini
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi android
susijanny
 
Android technology
Android technology Android technology
Android technology
vikas malviya
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
Android
AndroidAndroid
Android
Tapan Khilar
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Arnav Gupta
 
Chapter 1 - The Computer of The Future is in Your Hand.pdf
Chapter 1 - The Computer of The Future is in Your Hand.pdfChapter 1 - The Computer of The Future is in Your Hand.pdf
Chapter 1 - The Computer of The Future is in Your Hand.pdf
NeeshaJothi
 

Similar to Beating Android Fragmentation, Brett Duncavage (20)

Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA
 
18th android intro
18th android intro18th android intro
18th android intro
 
18th android intro
18th android intro18th android intro
18th android intro
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
 
Mobile Application Development powerpoint
Mobile Application Development powerpointMobile Application Development powerpoint
Mobile Application Development powerpoint
 
Android webinar class_1
Android webinar class_1Android webinar class_1
Android webinar class_1
 
Android based os
Android based osAndroid based os
Android based os
 
Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdf
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android Applications
Android ApplicationsAndroid Applications
Android Applications
 
Android ppt
Android ppt Android ppt
Android ppt
 
Developing for Android-Types of Android Application
Developing for Android-Types of Android ApplicationDeveloping for Android-Types of Android Application
Developing for Android-Types of Android Application
 
Android dev tips
Android dev tipsAndroid dev tips
Android dev tips
 
Android app development
Android app developmentAndroid app development
Android app development
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi android
 
Android technology
Android technology Android technology
Android technology
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Android
AndroidAndroid
Android
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
 
Chapter 1 - The Computer of The Future is in Your Hand.pdf
Chapter 1 - The Computer of The Future is in Your Hand.pdfChapter 1 - The Computer of The Future is in Your Hand.pdf
Chapter 1 - The Computer of The Future is in Your Hand.pdf
 

More from Xamarin

Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin University Presents: Building Your First Intelligent App with Xamarin...Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin
 
Xamarin University Presents: Ship Better Apps with Visual Studio App Center
Xamarin University Presents: Ship Better Apps with Visual Studio App CenterXamarin University Presents: Ship Better Apps with Visual Studio App Center
Xamarin University Presents: Ship Better Apps with Visual Studio App Center
Xamarin
 
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for XamarinGet the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Xamarin
 
Get the Most out of Android 8 Oreo with Visual Studio Tools for Xamarin
Get the Most out of Android 8 Oreo with Visual Studio Tools for XamarinGet the Most out of Android 8 Oreo with Visual Studio Tools for Xamarin
Get the Most out of Android 8 Oreo with Visual Studio Tools for Xamarin
Xamarin
 
Creative Hacking: Delivering React Native App A/B Testing Using CodePush
Creative Hacking: Delivering React Native App A/B Testing Using CodePushCreative Hacking: Delivering React Native App A/B Testing Using CodePush
Creative Hacking: Delivering React Native App A/B Testing Using CodePush
Xamarin
 
Build Better Games with Unity and Microsoft Azure
Build Better Games with Unity and Microsoft AzureBuild Better Games with Unity and Microsoft Azure
Build Better Games with Unity and Microsoft Azure
Xamarin
 
Exploring UrhoSharp 3D with Xamarin Workbooks
Exploring UrhoSharp 3D with Xamarin WorkbooksExploring UrhoSharp 3D with Xamarin Workbooks
Exploring UrhoSharp 3D with Xamarin Workbooks
Xamarin
 
Desktop Developer’s Guide to Mobile with Visual Studio Tools for Xamarin
Desktop Developer’s Guide to Mobile with Visual Studio Tools for XamarinDesktop Developer’s Guide to Mobile with Visual Studio Tools for Xamarin
Desktop Developer’s Guide to Mobile with Visual Studio Tools for Xamarin
Xamarin
 
Developer’s Intro to Azure Machine Learning
Developer’s Intro to Azure Machine LearningDeveloper’s Intro to Azure Machine Learning
Developer’s Intro to Azure Machine Learning
Xamarin
 
Customizing Xamarin.Forms UI
Customizing Xamarin.Forms UICustomizing Xamarin.Forms UI
Customizing Xamarin.Forms UI
Xamarin
 
Session 4 - Xamarin Partner Program, Events and Resources
Session 4 - Xamarin Partner Program, Events and ResourcesSession 4 - Xamarin Partner Program, Events and Resources
Session 4 - Xamarin Partner Program, Events and Resources
Xamarin
 
Session 3 - Driving Mobile Growth and Profitability
Session 3 - Driving Mobile Growth and ProfitabilitySession 3 - Driving Mobile Growth and Profitability
Session 3 - Driving Mobile Growth and Profitability
Xamarin
 
Session 2 - Emerging Technologies in your Mobile Practice
Session 2 - Emerging Technologies in your Mobile PracticeSession 2 - Emerging Technologies in your Mobile Practice
Session 2 - Emerging Technologies in your Mobile Practice
Xamarin
 
Session 1 - Transformative Opportunities in Mobile and Cloud
Session 1 - Transformative Opportunities in Mobile and Cloud Session 1 - Transformative Opportunities in Mobile and Cloud
Session 1 - Transformative Opportunities in Mobile and Cloud
Xamarin
 
SkiaSharp Graphics for Xamarin.Forms
SkiaSharp Graphics for Xamarin.FormsSkiaSharp Graphics for Xamarin.Forms
SkiaSharp Graphics for Xamarin.Forms
Xamarin
 
Building Games for iOS, macOS, and tvOS with Visual Studio and Azure
Building Games for iOS, macOS, and tvOS with Visual Studio and AzureBuilding Games for iOS, macOS, and tvOS with Visual Studio and Azure
Building Games for iOS, macOS, and tvOS with Visual Studio and Azure
Xamarin
 
Intro to Xamarin.Forms for Visual Studio 2017
Intro to Xamarin.Forms for Visual Studio 2017Intro to Xamarin.Forms for Visual Studio 2017
Intro to Xamarin.Forms for Visual Studio 2017
Xamarin
 
Connected Mobile Apps with Microsoft Azure
Connected Mobile Apps with Microsoft AzureConnected Mobile Apps with Microsoft Azure
Connected Mobile Apps with Microsoft Azure
Xamarin
 
Introduction to Xamarin for Visual Studio 2017
Introduction to Xamarin for Visual Studio 2017Introduction to Xamarin for Visual Studio 2017
Introduction to Xamarin for Visual Studio 2017
Xamarin
 
Building Your First iOS App with Xamarin for Visual Studio
Building Your First iOS App with Xamarin for Visual StudioBuilding Your First iOS App with Xamarin for Visual Studio
Building Your First iOS App with Xamarin for Visual Studio
Xamarin
 

More from Xamarin (20)

Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin University Presents: Building Your First Intelligent App with Xamarin...Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin University Presents: Building Your First Intelligent App with Xamarin...
 
Xamarin University Presents: Ship Better Apps with Visual Studio App Center
Xamarin University Presents: Ship Better Apps with Visual Studio App CenterXamarin University Presents: Ship Better Apps with Visual Studio App Center
Xamarin University Presents: Ship Better Apps with Visual Studio App Center
 
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for XamarinGet the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
 
Get the Most out of Android 8 Oreo with Visual Studio Tools for Xamarin
Get the Most out of Android 8 Oreo with Visual Studio Tools for XamarinGet the Most out of Android 8 Oreo with Visual Studio Tools for Xamarin
Get the Most out of Android 8 Oreo with Visual Studio Tools for Xamarin
 
Creative Hacking: Delivering React Native App A/B Testing Using CodePush
Creative Hacking: Delivering React Native App A/B Testing Using CodePushCreative Hacking: Delivering React Native App A/B Testing Using CodePush
Creative Hacking: Delivering React Native App A/B Testing Using CodePush
 
Build Better Games with Unity and Microsoft Azure
Build Better Games with Unity and Microsoft AzureBuild Better Games with Unity and Microsoft Azure
Build Better Games with Unity and Microsoft Azure
 
Exploring UrhoSharp 3D with Xamarin Workbooks
Exploring UrhoSharp 3D with Xamarin WorkbooksExploring UrhoSharp 3D with Xamarin Workbooks
Exploring UrhoSharp 3D with Xamarin Workbooks
 
Desktop Developer’s Guide to Mobile with Visual Studio Tools for Xamarin
Desktop Developer’s Guide to Mobile with Visual Studio Tools for XamarinDesktop Developer’s Guide to Mobile with Visual Studio Tools for Xamarin
Desktop Developer’s Guide to Mobile with Visual Studio Tools for Xamarin
 
Developer’s Intro to Azure Machine Learning
Developer’s Intro to Azure Machine LearningDeveloper’s Intro to Azure Machine Learning
Developer’s Intro to Azure Machine Learning
 
Customizing Xamarin.Forms UI
Customizing Xamarin.Forms UICustomizing Xamarin.Forms UI
Customizing Xamarin.Forms UI
 
Session 4 - Xamarin Partner Program, Events and Resources
Session 4 - Xamarin Partner Program, Events and ResourcesSession 4 - Xamarin Partner Program, Events and Resources
Session 4 - Xamarin Partner Program, Events and Resources
 
Session 3 - Driving Mobile Growth and Profitability
Session 3 - Driving Mobile Growth and ProfitabilitySession 3 - Driving Mobile Growth and Profitability
Session 3 - Driving Mobile Growth and Profitability
 
Session 2 - Emerging Technologies in your Mobile Practice
Session 2 - Emerging Technologies in your Mobile PracticeSession 2 - Emerging Technologies in your Mobile Practice
Session 2 - Emerging Technologies in your Mobile Practice
 
Session 1 - Transformative Opportunities in Mobile and Cloud
Session 1 - Transformative Opportunities in Mobile and Cloud Session 1 - Transformative Opportunities in Mobile and Cloud
Session 1 - Transformative Opportunities in Mobile and Cloud
 
SkiaSharp Graphics for Xamarin.Forms
SkiaSharp Graphics for Xamarin.FormsSkiaSharp Graphics for Xamarin.Forms
SkiaSharp Graphics for Xamarin.Forms
 
Building Games for iOS, macOS, and tvOS with Visual Studio and Azure
Building Games for iOS, macOS, and tvOS with Visual Studio and AzureBuilding Games for iOS, macOS, and tvOS with Visual Studio and Azure
Building Games for iOS, macOS, and tvOS with Visual Studio and Azure
 
Intro to Xamarin.Forms for Visual Studio 2017
Intro to Xamarin.Forms for Visual Studio 2017Intro to Xamarin.Forms for Visual Studio 2017
Intro to Xamarin.Forms for Visual Studio 2017
 
Connected Mobile Apps with Microsoft Azure
Connected Mobile Apps with Microsoft AzureConnected Mobile Apps with Microsoft Azure
Connected Mobile Apps with Microsoft Azure
 
Introduction to Xamarin for Visual Studio 2017
Introduction to Xamarin for Visual Studio 2017Introduction to Xamarin for Visual Studio 2017
Introduction to Xamarin for Visual Studio 2017
 
Building Your First iOS App with Xamarin for Visual Studio
Building Your First iOS App with Xamarin for Visual StudioBuilding Your First iOS App with Xamarin for Visual Studio
Building Your First iOS App with Xamarin for Visual Studio
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 

Beating Android Fragmentation, Brett Duncavage

  • 3. Know Thy Enemy • Android OSVersions • Device DisplayVariations • Hardware Configurations
  • 5. The Landscape • Over 40% of devices in the wild are running Gingerbread! (Android version 2.3.x,API level 8) • "Modern" Android OS versions (Honeycomb and higher) are < 50% of the market. • Thus, in order to reach all potential users in your market, you must deal with OS fragmentation.
  • 6. Basic Defense • Set targetSdk to the current highest API level. • Use helper classes to encapsulate OS version checking logic. Reflection will not work. But you can check Build.VERSION.SdkInt • Optionally set minSdk to the lower bound of Android API level your app supports. • It is possible to have multiple APKs in Google Play that support different Android API levels.
  • 8. Rdio’s Long Tail 77% 23% Total Android Users Top 10 Devices The Rest
  • 9. Rdio Device Distribution 31% 67% 2% Devices with over 1,000 users Devices with > 1 and < 1,000 users Devices with 1 user
  • 10. Rdio’s Long-tail (is long) • 2866 unique devices per month (as determined by Build.Product, Build.Model) • Top 10 devices represent 23% of all users • 255 devices represent 85% of all users • 894 devices had exactly (one) user
  • 11. How Did We Get This Data? • Not from Google Play. • Even a simple means of identifying the device types and Android versions running your app/service will prove invaluable. • Embedding the Build.Model, Build.Product, Build.VERSION.SdkInt into the User-Agent header, for example. • A service that pings an API endpoint every 24 hours. (The example app has an implementation of this method).
  • 12. Be Cautious • The product and model strings can be too granular sometimes. • Many devices with the same street name have multiple model and product strings. • The Samsung Galaxy S III has at least 5 unique model strings.
  • 13. PickYour Battles • Use data to drive your development focus. • Make smart decisions on where you cut off support. • It is _possible_ to support all the way down to Android 1.6, but is it worth it? • Focus on device-specific issues that a lot of your users have.
  • 15. Device DisplayVariations • Display dimensions • Display density (dpi) • Display quality • Don’t try to collect them all. • Use SDK tools to help during design
  • 16. Tools • Android support library:Adds support for certain features (such as Fragments) all the way back to Donut (1.6). • ActionBar Sherlock:An open source library that adds support for ActionBar to all versions of Android. http://actionbarsherlock.com • android-ui-utils: https://code.google.com/p/android-ui-utils/
  • 17. Use Fragments! • Activities are heavy, Fragments are light. • Allow for more flexible UI design and runtime configuration.
  • 18. Think in Points, not Pixels • You can’t make a pixel perfect implementation, so don’t try. • A point is a logical representation of a pixel, based on the actual size of a pixel on a 160dpi display. • When designing start with the baseline (160dpi), and extrapolate upwards. At this density 1pt == 1px (roughly).
  • 19. Think in Points, not Pixels • 9-patch is your friend. If your designers aren’t using 9-patch, make them. There is an excellent 9-patch tool that ships with the Android SDK (draw9patch). • 9-patch images are specially formatted PNGs that define what areas can and cannot be stretched.
  • 21. Design for Android • Don’t just take a design made for iOS and shoehorn it into Android. • Use Android UI idioms:ActionBar, long-press, support landscape orientation whenever possible, etc. • RTFM! Google provides some excellent resources on how to design and develop apps to support different display types.
  • 22. Level-upYour Layout! • Two easy, and often overlooked, resources are dimens.xml, and integers.xml. • Use Android’s resource directory structure to include multiple versions (as with any resource). Layout-land, Layout-large, etc. • For example, define number of columns in a grid view in integers.xml so different values will be used depending on screen size and orientation (in lieu of using auto_fit).
  • 25. Level-upYour Layout! • Use layout aliases: Define your different layouts (single_pane.xml, dual_pane.xml, etc) in Resource/Layout, and provide mappings in the size-qualified values directories (Resource/Values-large, etc). • This saves you from having duplicate layouts residing in different Layout directories (i.e. Layout-large/ and Layout-sw600dp/).
  • 26. Don’t Forget About Focused State • When designing buttons, or any other clickable/tappable widget, don’t forget to supply a focused state. • Without the focused state, the pointing device becomes useless as the user will have no visual feedback to indicate which control has focus and will be activated on click. •<item android:state_focused="true" android:drawable="@drawable/button_focused" />
  • 27. Hardware Fragmentation • May not be an issue depending on your application’s domain. • Use your manifest to inform Google Play of your hardware requirements (requires camera, etc). • Use available APIs to determine fallback action at runtime if optional peripheral is not available. Such as SensorManager.
  • 28. External Storage • Not always external or removable • Never use a hardcoded path! /sdcard is wrong, wrong, wrong. • Environment.ExternalDirectory can return a path to internal storage. • Store vital application data on internal storage (sqlite database, etc).
  • 29. Media Framework • OEMs use many different vendors for their media hardware needs. • OEMs don’t always or can’t use the default Android MediaPlayer implementation. • This means the MediaPlayer can behave in insane ways.
  • 30. How Rdio Mitigates Device Issues • Trial and Error (and sometimes luck). • Beta users group. • Send one-off test builds to affected users. • Remote device laboratories such as DeviceAnywhere and Perfecto Mobile.
  • 31. Conclusion • You have no choice, you will encounter fragmentation. • Be pragmatic, choose your battles, and use usage data to backup your decisions on where to focus resources. • Design for Android! Android is not iOS,Android users are not iOS users, make an app that Android users will like.
  • 32. Thanks! • There are 4 of us from Rdio at Evolve (Anthony, Eric, Patrick, and myself), if you see us, say hi! • Brett Duncavage, Rdio Android Lead • @xforward, http://brett.duncavage.org • Source for example available here: https://github.com/bduncavage/ evolve2013
  • 33. Biblography • Android OSVersion Distribution: http://developer.android.com/ about/dashboards/index.html • Android Designing for Multiple Screens: http:// developer.android.com/training/multiscreen/index.html • ActionBar Sherlock: http://actionbarsherlock.com • android-ui-utils: https://code.google.com/p/android-ui-utils/