This session will teach you the details about Android Fragmentation and the different ways in which it impacts your app, your audience and your development processes. You will learn about the different types of fragmentation present on the Android ecosystem and how each type affects different categories of apps in specific ways. We will also explore some of the tools used by most Android developers to effectively beat fragmentation and learn some best practices and strategies to leverage these tools in creating highly successful Android apps.
Beating Android Fragmentation
• Types of fragmentation
• Best practices
Who am I?
• Mobile Engineer at Eventbrite
• Previously at OneLouder Apps
• Android & Python Developer
Over 2 million events
150 million tickets sold
$2 billion in gross ticket sales
Events in 179 countries
Eventbrite by the Numbers
Is it really that bad?
Android Fragmentation Visualized (http://bit.ly/1fvOXF0)
Types of fragmentation
• OS Fragmentation
• OEM Fragmentation
• Hardware Fragmentation
Mainly refers to the different versions of Android being
used at the same time
• Android Forks
• Other OSes with Android app support
• TouchWiz (Samsung)
• Sense (HTC)
• MotoBlur (Motorola)
• OEM OS modifications.
• Changes to AOSP even on certain API calls.
• All the different types of Hardware features
(keyboard, camera, screen, HW buttons, etc).
• Android is designed to manage HW fragmentation
• The pain points in this area are on low level things like
different chipsets, GPUs, CPU cores, etc.
• Android x86 is the extreme example of this.
• Set minSdkVersion to the lowest API Level you want
• Set targetSdkVersion to the current highest API
• Use Android Lint to find code that is not supported
by your minimum API Level (and other possible
• Use fragments when possible.
• Encapsulate your version checking logic
• Don’t fill your code with this:
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.#####)
• Use the Support Libraries
• Follow the Android Design Guidelines
• Beware of Google Play Services!
• Support Library v4
• Rich Notifications, View Pager, Navigation Drawer,
• Support Library v7
• Grid Layout, Media Router
• Support Library v8
• Renderscript for API Level < 14
• Android Asset Studio
• Square libraries:
• OkHttp, Picasso, Wire, Retrofit
• CommonsWare libraries
• Avoid using Apache HTTPClient
• Only use if you’re still supporting API Level < 10
• You should be using URLConnection and its
• Better yet use OkHttp from Square (fork of
• You could also use Volley from Google
Migrate to Gradle
• Gradle is a powerful tool that can help manage
complicated compatibility scenarios.
• Use “flavors” and “buildTypes” to create different
APKs for different OSes, chipsets, etc (Kindle, Nook,
Tegra, x86, Blackberry, even 2.x and 4.x versions).
API Levels Recommendations
• Older projects should be supporting API Level ≥ 8
• Recommended would be API Level ≥ 10
• If you’re already using ActionBarSherlock, no need
to migrate to ActionBarCompat.
• New projects should start with minSdkVersion=”14”
• If you absolutely have to support API Level ≥ 8 then
• This is a new “movement”
within the Android community
that advocates dropping
support for older versions of
Android (mainly 2.x)
• Started by Jeff Gilfelt at
Google I/O last year
• Advocated by Reto Meier from
Google during I/O and other
Lots of Testing
• Hopefully automated!
• Test on actual devices
• Use tools like JUnit, Espresso, Monkey, Roboelectric,
• Leverage something like Spoon (from Square) to run
your tests on multiple devices.
• Measure everything
• Make decisions
based on your data
• Analytics suites:
• Get a tool to monitor crashes
• Lots of options, including:
• Crashlytics (Free)
• Some analytics suites provide this as well (like Flurry)
• Worst case, use Google Play Dev Console
Tools from Google
• Multiple APK support.
• Alpha and Beta groups
• Combined with Analytics + Crash reporting
• Beta users can’t post reviews
• Staged rollouts.
• Android fragmentation is massively over hyped!
• Be aware of the different types of fragmentation
• Use libraries to homogenize feature support.
• Start planning on dropping 2.x support (Old projects)
• minSdkVersion=”14” on all new projects
• Leverage Gradle to create multiple versions if needed.
• Do lots of tests (Hopefully automated and on devices)
• Use Analytics + Crash reporting
• Create a Beta community and use staged rollouts.
• Rinse and repeat
Eventbrite Tech Talk:
Android Development + Design
February 18, 2014 @ 6:30 PM
If you’re interested, let’s talk after the session
Download our apps: