Submit Search
Upload
Backwards Compatibility: Strategies and Tactics
•
0 likes
•
1,607 views
C
CommonsWare
Follow
From the AnDevCon III conference
Read less
Read more
Technology
Education
Report
Share
Report
Share
1 of 24
Download now
Download to read offline
Recommended
Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012
Opersys inc.
Introduction to android
Introduction to android
krishnastudent88
Slides bootcamp21
Slides bootcamp21
dxsaki
Android dev o_auth
Android dev o_auth
lzongren
Introduction to android sessions new
Introduction to android sessions new
Joe Jacob
Android Development Tutorial V3
Android Development Tutorial V3
Diego Torres Milano
Build Trust in Your Build-to-Deployment Flow!
Build Trust in Your Build-to-Deployment Flow!
Baruch Sadogursky
Android chapter02-setup2-emulator
Android chapter02-setup2-emulator
guru472
Recommended
Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012
Opersys inc.
Introduction to android
Introduction to android
krishnastudent88
Slides bootcamp21
Slides bootcamp21
dxsaki
Android dev o_auth
Android dev o_auth
lzongren
Introduction to android sessions new
Introduction to android sessions new
Joe Jacob
Android Development Tutorial V3
Android Development Tutorial V3
Diego Torres Milano
Build Trust in Your Build-to-Deployment Flow!
Build Trust in Your Build-to-Deployment Flow!
Baruch Sadogursky
Android chapter02-setup2-emulator
Android chapter02-setup2-emulator
guru472
Android Programming Basic
Android Programming Basic
Duy Do Phan
Basic android development
Basic android development
Upanya Singh
Android Programming
Android Programming
Pasi Manninen
Android session-1-sajib
Android session-1-sajib
Hussain Behestee
9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)
Peter Mburu
Developing and-benchmarking-native-linux-applications-on-android
Developing and-benchmarking-native-linux-applications-on-android
Elvis Jon Freddy Sitinjak
Mobile Java
Mobile Java
Nikita Makarov
Android
Android
Ravina Bhavsar
Ii 1300-java essentials for android
Ii 1300-java essentials for android
Adrian Mikeliunas
Introduction to Android Development Part 1
Introduction to Android Development Part 1
Kainda Kiniel Daka
Android and its feature
Android and its feature
Shubham Kumar
Ii 1500-publishing your android application
Ii 1500-publishing your android application
Adrian Mikeliunas
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
Kasun Dananjaya Delgolla
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
ddrschiw
Rationalize Android Development with StAnD - Clement Escoffier, akquinet
Rationalize Android Development with StAnD - Clement Escoffier, akquinet
Paris Open Source Summit
Introduction to Android Development
Introduction to Android Development
Can Elmas
AD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And Tomorrow
pjanzen11
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
Boom Shukla
MTJ Taking Mobile Java Developers to the Next Level
MTJ Taking Mobile Java Developers to the Next Level
gustavoeliano
Android Development Workshop
Android Development Workshop
Peter Robinett
Securing User Data with SQLCipher
Securing User Data with SQLCipher
CommonsWare
App Integration (Revised and Updated)
App Integration (Revised and Updated)
CommonsWare
More Related Content
What's hot
Android Programming Basic
Android Programming Basic
Duy Do Phan
Basic android development
Basic android development
Upanya Singh
Android Programming
Android Programming
Pasi Manninen
Android session-1-sajib
Android session-1-sajib
Hussain Behestee
9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)
Peter Mburu
Developing and-benchmarking-native-linux-applications-on-android
Developing and-benchmarking-native-linux-applications-on-android
Elvis Jon Freddy Sitinjak
Mobile Java
Mobile Java
Nikita Makarov
Android
Android
Ravina Bhavsar
Ii 1300-java essentials for android
Ii 1300-java essentials for android
Adrian Mikeliunas
Introduction to Android Development Part 1
Introduction to Android Development Part 1
Kainda Kiniel Daka
Android and its feature
Android and its feature
Shubham Kumar
Ii 1500-publishing your android application
Ii 1500-publishing your android application
Adrian Mikeliunas
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
Kasun Dananjaya Delgolla
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
ddrschiw
Rationalize Android Development with StAnD - Clement Escoffier, akquinet
Rationalize Android Development with StAnD - Clement Escoffier, akquinet
Paris Open Source Summit
Introduction to Android Development
Introduction to Android Development
Can Elmas
AD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And Tomorrow
pjanzen11
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
Boom Shukla
MTJ Taking Mobile Java Developers to the Next Level
MTJ Taking Mobile Java Developers to the Next Level
gustavoeliano
Android Development Workshop
Android Development Workshop
Peter Robinett
What's hot
(20)
Android Programming Basic
Android Programming Basic
Basic android development
Basic android development
Android Programming
Android Programming
Android session-1-sajib
Android session-1-sajib
9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)
Developing and-benchmarking-native-linux-applications-on-android
Developing and-benchmarking-native-linux-applications-on-android
Mobile Java
Mobile Java
Android
Android
Ii 1300-java essentials for android
Ii 1300-java essentials for android
Introduction to Android Development Part 1
Introduction to Android Development Part 1
Android and its feature
Android and its feature
Ii 1500-publishing your android application
Ii 1500-publishing your android application
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
Rationalize Android Development with StAnD - Clement Escoffier, akquinet
Rationalize Android Development with StAnD - Clement Escoffier, akquinet
Introduction to Android Development
Introduction to Android Development
AD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And Tomorrow
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
MTJ Taking Mobile Java Developers to the Next Level
MTJ Taking Mobile Java Developers to the Next Level
Android Development Workshop
Android Development Workshop
Similar to Backwards Compatibility: Strategies and Tactics
Securing User Data with SQLCipher
Securing User Data with SQLCipher
CommonsWare
App Integration (Revised and Updated)
App Integration (Revised and Updated)
CommonsWare
Gradle and Your Android Wearable Projects
Gradle and Your Android Wearable Projects
CommonsWare
App integration: Strategies and Tactics
App integration: Strategies and Tactics
CommonsWare
Android workshop material
Android workshop material
Reza Yogaswara
From Android to the Mobile Web
From Android to the Mobile Web
CommonsWare
What's New in Jelly Bean
What's New in Jelly Bean
CommonsWare
Gl android platform
Gl android platform
Pragya Rastogi
Android My Seminar
Android My Seminar
Ganesh Waghmare
Continuous integration for androids
Continuous integration for androids
Kirill Zotin
Seminar on android app development
Seminar on android app development
AbhishekKumar4779
Android studio&Gradle&Autotest
Android studio&Gradle&Autotest
毅 方
Android Attacks
Android Attacks
Michael Scovetta
Android Platform Architecture
Android Platform Architecture
Naresh Chintalcheru
Android_Studio_Structure.docx
Android_Studio_Structure.docx
KNANTHINIMCA
Android Development in a Nutshell
Android Development in a Nutshell
Aleix Solé
Android ndk
Android ndk
Sentinel Solutions Ltd
Android NDK
Android NDK
Sentinel Solutions Ltd
Android Application Development Using Java
Android Application Development Using Java
amaankhan
Android
Android
Lina Shamiah
Similar to Backwards Compatibility: Strategies and Tactics
(20)
Securing User Data with SQLCipher
Securing User Data with SQLCipher
App Integration (Revised and Updated)
App Integration (Revised and Updated)
Gradle and Your Android Wearable Projects
Gradle and Your Android Wearable Projects
App integration: Strategies and Tactics
App integration: Strategies and Tactics
Android workshop material
Android workshop material
From Android to the Mobile Web
From Android to the Mobile Web
What's New in Jelly Bean
What's New in Jelly Bean
Gl android platform
Gl android platform
Android My Seminar
Android My Seminar
Continuous integration for androids
Continuous integration for androids
Seminar on android app development
Seminar on android app development
Android studio&Gradle&Autotest
Android studio&Gradle&Autotest
Android Attacks
Android Attacks
Android Platform Architecture
Android Platform Architecture
Android_Studio_Structure.docx
Android_Studio_Structure.docx
Android Development in a Nutshell
Android Development in a Nutshell
Android ndk
Android ndk
Android NDK
Android NDK
Android Application Development Using Java
Android Application Development Using Java
Android
Android
More from CommonsWare
Getting Android Developers for Your Wearables
Getting Android Developers for Your Wearables
CommonsWare
When Microwatts Are Precious: Battery Tips for Wearable Apps
When Microwatts Are Precious: Battery Tips for Wearable Apps
CommonsWare
The Action Bar: Front to Back
The Action Bar: Front to Back
CommonsWare
Android Security: Defending Your Users
Android Security: Defending Your Users
CommonsWare
Secondary Screen Support Using DisplayManager
Secondary Screen Support Using DisplayManager
CommonsWare
Mastering the Master Detail Pattern
Mastering the Master Detail Pattern
CommonsWare
Not Quite As Painful Threading
Not Quite As Painful Threading
CommonsWare
Android Development: The 20,000-Foot View
Android Development: The 20,000-Foot View
CommonsWare
Maps V2... And You!
Maps V2... And You!
CommonsWare
A Deep Dive Into ViewPager
A Deep Dive Into ViewPager
CommonsWare
Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2
CommonsWare
Integrate Android Apps and Web Apps
Integrate Android Apps and Web Apps
CommonsWare
X Means Y
X Means Y
CommonsWare
The Wonderful World of Wearables
The Wonderful World of Wearables
CommonsWare
Beaming Data to Devices with NFC
Beaming Data to Devices with NFC
CommonsWare
Making Money at Mobile: 60 Business Models
Making Money at Mobile: 60 Business Models
CommonsWare
AppsWorld Keynote
AppsWorld Keynote
CommonsWare
Rich Text Editing and Beyond
Rich Text Editing and Beyond
CommonsWare
Android Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... Odd
CommonsWare
Google TV For Fun
Google TV For Fun
CommonsWare
More from CommonsWare
(20)
Getting Android Developers for Your Wearables
Getting Android Developers for Your Wearables
When Microwatts Are Precious: Battery Tips for Wearable Apps
When Microwatts Are Precious: Battery Tips for Wearable Apps
The Action Bar: Front to Back
The Action Bar: Front to Back
Android Security: Defending Your Users
Android Security: Defending Your Users
Secondary Screen Support Using DisplayManager
Secondary Screen Support Using DisplayManager
Mastering the Master Detail Pattern
Mastering the Master Detail Pattern
Not Quite As Painful Threading
Not Quite As Painful Threading
Android Development: The 20,000-Foot View
Android Development: The 20,000-Foot View
Maps V2... And You!
Maps V2... And You!
A Deep Dive Into ViewPager
A Deep Dive Into ViewPager
Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2
Integrate Android Apps and Web Apps
Integrate Android Apps and Web Apps
X Means Y
X Means Y
The Wonderful World of Wearables
The Wonderful World of Wearables
Beaming Data to Devices with NFC
Beaming Data to Devices with NFC
Making Money at Mobile: 60 Business Models
Making Money at Mobile: 60 Business Models
AppsWorld Keynote
AppsWorld Keynote
Rich Text Editing and Beyond
Rich Text Editing and Beyond
Android Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... Odd
Google TV For Fun
Google TV For Fun
Recently uploaded
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Enterprise Knowledge
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
jfdjdjcjdnsjd
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
hans926745
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
UK Journal
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Enterprise Knowledge
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
Recently uploaded
(20)
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Backwards Compatibility: Strategies and Tactics
1.
AnDevCon III
Backwards Compatibility: Strategies and Tactics Copyright © 2012 CommonsWare, LLC
2.
Device Mix
image Copyright © 2012 Google, Inc. – reprinted with permission Copyright © 2012 CommonsWare, LLC
3.
Device Mix
● The Market Is Not the World ● Kindle Fire ● NOOK Tablet ● Wearables (WIMM, I'm Watch, etc.) ● Miscellaneous non-Market devices ● If You Distribute to These, Take Their Versions Into Account! Copyright © 2012 CommonsWare, LLC
4.
Device Mix
● Predictions Sure To Go Wrong ● November 2012: ICS and newer reaches majority status – New device sales – Upgrades for existing devices ● December 2012: Mayan Apocalypse ● April 2013: Android 2.x below 20% ● September 2013: Android 2.x below 5% ● December 2013: Ragnarök Copyright © 2012 CommonsWare, LLC
5.
Competing Strategies
● Old API-Centric ● Lowest common denominator ● Today: Android 2.3, maybe 2.2 ● Only deal with newer things when unavoidable ● New API-Centric ● More aggressively support newer capabilities – Particularly with respect to UI ● Today: ICS ● Gracefully degrade for older devices Copyright © 2012 CommonsWare, LLC
6.
Forwards, Not Backwards
● Older Ain't Gettin' Any Bigger ● Aim for the increasing market share, not the decreasing share ● Sneezers' Devices ● Bloggers, media, etc. ● Tend towards newer devices ● If you look stale, may impact their interest in you Copyright © 2012 CommonsWare, LLC
7.
Forwards, Not Backwards
● Distinctive, Not Decomposing ● Are there new features that can give you a competitive edge? – Even if not all the users can take advantage of them ● It's the Way the (Web) World Works ● IE6-only versus graceful degradation ● Well-trod path, needing Android-specific tactics Copyright © 2012 CommonsWare, LLC
8.
Targets and Strategies
● Old API-Centric ● Build target = min SDK version = lowest common denominator ● Target SDK version no higher than min SDK version ● New API-Centric ● Build target = oldest version that has everything you are using directly (or via library) ● Min SDK version = oldest you are supporting ● Target SDK version = current-ish Android version Copyright © 2012 CommonsWare, LLC
9.
Validating Compatibility
● Compile-Time: Lint ● Keep your Android SDK tools/ADT updated! ● Will warn you when you try using newer stuff on older minSdkVersion – Requires manual lint run from Eclipse menu ● Use annotations to suppress warnings – @TargetApi(NN) Copyright © 2012 CommonsWare, LLC
10.
Validating Compatibility
● Testing ● Directly via emulator ● Directly via available hardware ● Bulk-testing Services – TestDroid Cloud – LessPainful – Apkudo – Etc. Copyright © 2012 CommonsWare, LLC
11.
Libraries for Compatibility
● Android Support Package ● Fragments – Large subset, but not everything from native API Level 11+ ● Loaders ● GridLayout ● *Compat Classes – Access to newer constants – Helper methods to get at newer capabilities while gracefully degrading to no-ops/defaults ● Separate Implementations Copyright © 2012 CommonsWare, LLC
12.
Libraries for Compatibility
● Action Bar Sherlock ● Implementation of ActionBar for Android 2.x ● Same API as native API Level 11+ ● Nine Old Androids ● Implementation of android.animation framework for Android 1.x/2.x Copyright © 2012 CommonsWare, LLC
13.
Ad-Hoc Backports
● Find AOSP Code, Clone, Fix ● New widgets (e.g., Switch) ● Other stuff largely separable from firmware ● Challenges – Finding resources – Dealing with package-private methods Copyright © 2012 CommonsWare, LLC
14.
Library/Backport Strategy
● Use as Temporary Scaffolding ● Know which API levels a given library or backport is addressing ● May vary by what you are using ● Remove In Time ● Once you no longer are supporting the older API levels, drop the scaffold and re-test Copyright © 2012 CommonsWare, LLC
15.
Java Version Guards
● Android 2.x+ ● Wrap any references to items from newer API level in a test of the API level if (Build.VERSION.SDK_INT>Build.VERSION_CODES.GINGERBREAD) { // do something } Copyright © 2012 CommonsWare, LLC
16.
Java Version Guards
● Android 2.x+ ● Wrap any references to items from newer API level in a test of the API level if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.GINGERBREAD) { @TargetApi(11) // do something needing API Level 11+ } Copyright © 2012 CommonsWare, LLC
17.
Java Version Guards
● Scenario: AsyncTask ● Serialized if targetSdkVersion >= 14 ● Use executeOnExecutor() to force to classic thread pool model ● Problem: executeOnExecutor() new to API Level 11 ● Solution: version guard block Copyright © 2012 CommonsWare, LLC
18.
Java Version Guards
● Android 1.x ● Problem: Dalvik complains if you load a class that refers to items from a newer API level ● Solution – Isolate newer-API items in a separate helper class – Only refer to that helper class within a version guard block Copyright © 2012 CommonsWare, LLC
19.
Java Version Guards
● The Old API-Centric Approach ● Use version guard to detect newer API level ● Use reflection to access items that only exist at that API level ● Benefit: can leave build target on older API level – Build target only affects what you directly reference Copyright © 2012 CommonsWare, LLC
20.
Versioned Resources
● Use -vNN Resource Set Suffix ● Apply to resources valid for API Level NN and higher ● Scenario – res/values/ = good for anything – res/values-v11/ = good for Honeycomb and newer ● Example – Style in -v11 that references Theme.Holo – Style with same name in default directory that does not reference Theme.Holo Copyright © 2012 CommonsWare, LLC
21.
Versioned Components
● Components Valid for Certain API Levels ● Activity only needed on Android 3.1+ ● Different app widgets for API Level 11, older devices ● Technique ● Boolean resource, contained in two resource sets – Default plus -vNN set ● Use boolean resource in android:enabled attribute in manifest – Disabled components do not show up anywhere Copyright © 2012 CommonsWare, LLC
22.
Scenario: Preferences
● Goals ● Want to use PreferenceFragments and headers on API Level 11 and higher ● Want preferences to still work on Android 2.x ● Option #1: Different PreferenceActivity Classes ● Use versioned components trick to dictate which one is available ● Use action, not component, in launching Intent ● Reuse preference XML as best you can Copyright © 2012 CommonsWare, LLC
23.
Scenario: Preferences
● Option #2: Version Guards ● One PreferenceActivity ● onBuildHeaders() only called on API Level 11+ ● Reuse preference XML as best you can ● Option #3: Backport ● Find current implementation (source, resources) ● Convert to use Android Support fragments ● Most difficulty, but consistent implementation, look-and-feel Copyright © 2012 CommonsWare, LLC
24.
QOTD “You’re
a Web developer in Java” is the first thing I tell every person mentioning fragmentation. There are no tablets. There are no phones. There’s no Google TV. There is only an unlimited set of configurations of every conceivable feature. Write your application in a dynamic, progressively enhancing manner that follows well- documented patterns and you will be just fine. Jake Wharton Copyright © 2012 CommonsWare, LLC
Download now