Slide 1

Slide 1 text

Managing Android Fragmentation Saud Khan! @bidyut

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Agenda • Various fragmentation points • Battles we fought at Twitter • Steps to take to make life easier • Q&A

Slide 4

Slide 4 text

Devices Courtesy: OpenSignal.com

Slide 5

Slide 5 text

Screen Sizes Courtesy: OpenSignal.com

Slide 6

Slide 6 text

Manufacturers Courtesy: OpenSignal.com

Slide 7

Slide 7 text

Hardware • Hardware buttons • Hardware keyboard • Camera support • Various sensors

Slide 8

Slide 8 text

Android Stack Courtesy: developer.android.com

Slide 9

Slide 9 text

Twitter Users 11/11/11 11:11

Slide 10

Slide 10 text

Twitter Android Users

Slide 11

Slide 11 text

Global Town Square

Slide 12

Slide 12 text

How do we manage?

Slide 13

Slide 13 text

3 Questions • What are the key features of the app? • What minimum API level are these features available at? • What legacy devices are you comfortable leaving behind?

Slide 14

Slide 14 text

Twitter Android Users

Slide 15

Slide 15 text

Who do we support? • Froyo and up • Eclair in maintenance

Slide 16

Slide 16 text

Android for All • Target MDPI (medium density) • Only include assets for MDPI • No support for photo filters

Slide 17

Slide 17 text

Android for All APK size of around 4 MB

Slide 18

Slide 18 text

Where do we start?

Slide 19

Slide 19 text

Quick Wins • Screen sizes and orientation • Density-independent pixel (dp) • Scale-independent pixel (sp)

Slide 20

Slide 20 text

1080p 720p

Slide 21

Slide 21 text

Quick wins • Screen sizes and orientation • Density-independent pixel (dp) • Scale-independent pixel (sp) • Multiple languages

Slide 22

Slide 22 text

Multiple Languages Courtesy: UNESCO

Slide 23

Slide 23 text

Example Tweet <item name="android:layout_width">@dimen/user_image_size</item> <item name="android:layout_height">@dimen/user_image_size</item> <item name="android:layout_marginRight">@dimen/list_row_padding</item> <item name="android:layout_alignParentLeft">true</item>

Slide 24

Slide 24 text

Example Tweet <item name="android:layout_marginRight">0dp</item> <item name="android:layout_marginLeft">@dimen/list_row_padding</item> <item name="android:layout_alignParentLeft">false</item> <item name="android:layout_alignParentRight">true</item>

Slide 25

Slide 25 text

layout/user_info.xml                                                                      

Slide 26

Slide 26 text

layout-ar-v15/user_info.xml                                                                      

Slide 27

Slide 27 text

Right-To-Left • Jellybean and newer • Different language codes • Arabic (ar) • Farsi (fa) • Hebrew (iw, he)

Slide 28

Slide 28 text

Debug mode

Slide 29

Slide 29 text

Quick wins • Screen sizes and orientation • Density-independent pixel (dp) • Scale-independent pixel (sp) • Multiple languages • Android Support libraries

Slide 30

Slide 30 text

ViewPager

Slide 31

Slide 31 text

Let the tools do the heavy lifting

Slide 32

Slide 32 text

ActionBar

Slide 33

Slide 33 text

ActionBar • No support in Gingerbread • No expansion in Honeycomb • Differences in Ice Cream Sandwich and Jellybean

Slide 34

Slide 34 text

Jellybean • Utilizing ActionBar

Slide 35

Slide 35 text

Gingerbread • Old title bar look • Custom expanded look

Slide 36

Slide 36 text

Honeycomb • Utilizing ActionBar • Native Android search

Slide 37

Slide 37 text

public  static  ActionBarHelper  newInstance(Activity  activity)  {          if  (Build.VERSION.SDK_INT  <  Build.VERSION_CODES.HONEYCOMB)  {                  return  new  ActionBarHelperCompat(activity);          }  else  if  (Build.VERSION.SDK_INT  <                                Build.VERSION_CODES.ICE_CREAM_SANDWICH)  {                  return  new  ActionBarHelperHoneycomb(activity);          }  else  {                  return  new  ActionBarHelperICS(activity);          }   }

Slide 38

Slide 38 text

Hardware buttons • Search button vs Action Bar • Menu button vs Overflow menu

Slide 39

Slide 39 text

Database • Different versions of SQLite • Test with the lowest supporting API

Slide 40

Slide 40 text

• Improving DB queries by joining tables instead of views • Wasn’t a good idea for complicated joins under Eclair

Slide 41

Slide 41 text

Native Libraries • A set for each architecture • Size vs Complexity

Slide 42

Slide 42 text

Photo filters • Issues with different photos • Random failures in native code • Exceptions for various unique devices

Slide 43

Slide 43 text

What’s next?

Slide 44

Slide 44 text

Testing • Multi API level testing • Multiple languages • Various OEM devices • UI automation

Slide 45

Slide 45 text

Support • Crashlytics • Listen to the feed

Slide 46

Slide 46 text

Crashlytics

Slide 47

Slide 47 text

Build Tools • Android for All • Beta, Release • Gradle flavors

Slide 48

Slide 48 text

Versioning • Numeric name spacing • OOSSDDVVV • OS API level • Screen size • Display Density • Version Courtesy: developer.android.com

Slide 49

Slide 49 text

Versioning • 070001050 • 100000050 • 140000050 • 070001054! • 100000075! • 140000051

Slide 50

Slide 50 text

Thank you @bidyut