Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Froyo to KitKat
Two Years Developing & Maintaining DeliRadio
by Andy Dyer
About Me
• Android & Rails developer at ChaiOne in Houston, Texas, USA
• Android apps on Google Play - DeliRadio, Music Li...
About DeliRadio
• Explore local concert
calendars
• Stream stations based on
location or specific venues
• Share discoverie...
About DeliRadio - Navigation & Filters
About DeliRadio - Server Architecture
• Sinatra/Ruby API used by Android, iOS, and
third-party clients
• Virtual private c...
Supported Android Versions Over Time
Early 2012
Min: Froyo
Max: Honeycomb
Mid 2012
Min: Froyo
Max: ICS
Early 2013
Min: Gin...
Topics
• Development Tools & Build Process
• Libraries Used
• Graphics & User Interface
• QA & Testing
Topics
• Development Tools & Build Process
• Libraries Used
• Graphics & User Interface
• QA & Testing
Development Tools (Early to Mid 2012)
Eclipse
• But which one?
• Build System: Ant
• Dependencies:
JAR files or
Maven (if y...
Development Tools (Mid 2012 to Mid 2013)
Android Developer Tools (ADT) Bundle
• Android specific version of Eclipse
• Sligh...
Build Process - Eclipse & ADT
• Initial approach - File > Export, manually enter
keystore password, etc.
• Slightly better...
Build Process - Eclipse & ADT
Problems with this approach
• Non-standard
• Templates must be be updated instead of
main fil...
Development Tools (Mid 2013 to Present)
Android Studio
• Gradle
• Maven dependencies - Similar to Ruby Gems
Build Process - Android Studio
Gradle
• Release & debug resources - automatically
merged during build process, no need for...
Gradle Build - Config-Specific Resources
android {
!
// ...
!
sourceSets {
debug {
manifest {
srcFile 'gradle/debug/AndroidM...
Gradle Build - Release Signing
android {
!
// ...
!
signingConfigs {
release {
storeFile file("../my_keystore.jks")
storeP...
Gradle Build - Version Code Increment
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0
!
task('increaseVersi...
Gradle Build - Version Code Increment
android {
!
// ...
!
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionNam...
Gradle Build - Test Fairy Upload
buildscript {
repositories {
mavenCentral()
maven { url 'https://www.testfairy.com/maven'...
Topics
• Development Tools & Build Process
• Libraries Used
• Graphics & User Interface
• QA & Testing
Libraries Used - API (Early 2012 to Mid 2013)
• Apache HTTP Client - API requests
• Ignition Library - Caching & async ima...
Libraries Used - API (Mid 2013 to Present)
• Volley - API requests & caching
Pro Tip:
compile 'com.mcxiaoke.volley:library...
Libraries Used - User Interface
• Smooth Progress Bar - Dashed progress bar
similar to Gmail, etc.
• Sticky List Headers
•...
Libraries Used - User Interface
• Butter Knife - View Injection
!
!
@InjectView(R.id.profile_username) TextView username;
...
Libraries Used - Social Networks
• Facebook SDK
• Twitter4J
• Signpost - Twitter OAuth flow
Libraries Used - Miscellaneous
• Google Play Services - Battery friendly
location
• GreenDAO ORM - Much simpler than conte...
Topics
• Development Tools & Build Process
• Libraries Used
• Graphics & User Interface
• QA & Testing
Graphics & User Interface
• iOS design != Android design - But iOS 7
blurred the lines
• Retina images - XHDPI
• Non-Retin...
Graphics - Using an Icon Font
1. Use Font Awesome web font or your own font
for scalable, styleable icons
2. Map font char...
Graphics - Icon Font in Layouts
<com.FontAwesome.Example.TextAwesome
android:id="@+id/text_prost_icon"
android:layout_widt...
User Interface - Multiple Screen Sizes
• Use ActionBarCompat & Nine Old Androids if
supporting Gingerbread or lower
• Use ...
Topics
• Development Tools & Build Process
• Libraries Used
• Graphics & User Interface
• QA & Testing
QA & Testing - Devices
• Too many to test them all
• Attempt to test a representative sample
• Major manufacturers - HTC/M...
QA Testing - Process
• Bugs & features entered in Pivotal Tracker
• Multiple builds delivered for testing each week
• Use ...
Vielen Dank!
K andydyer.org	
n @dammitandy
g plus.google.com/+AndrewDyer
Froyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradio
Upcoming SlideShare
Loading in …5
×

Froyo to kit kat two years developing & maintaining deliradio

603 views

Published on

  • Be the first to comment

Froyo to kit kat two years developing & maintaining deliradio

  1. 1. Froyo to KitKat Two Years Developing & Maintaining DeliRadio by Andy Dyer
  2. 2. About Me • Android & Rails developer at ChaiOne in Houston, Texas, USA • Android apps on Google Play - DeliRadio, Music Library, and Wrist Presenter • Hobbies/Interests - Vinyl collector, coffee & beer snob, burger aficionado • Ich lerne Deutsch
  3. 3. About DeliRadio • Explore local concert calendars • Stream stations based on location or specific venues • Share discoveries with friends • Receive notifications when favorite artists play nearby
  4. 4. About DeliRadio - Navigation & Filters
  5. 5. About DeliRadio - Server Architecture • Sinatra/Ruby API used by Android, iOS, and third-party clients • Virtual private cloud • Web, database, and job servers • Hosted on Amazon S3 & CloudFront CDN • ElasticSearch & Redis for caching & high performance search
  6. 6. Supported Android Versions Over Time Early 2012 Min: Froyo Max: Honeycomb Mid 2012 Min: Froyo Max: ICS Early 2013 Min: Gingerbread Max: Jelly Bean Early 2014 Min: ICS Max: KitKat
  7. 7. Topics • Development Tools & Build Process • Libraries Used • Graphics & User Interface • QA & Testing
  8. 8. Topics • Development Tools & Build Process • Libraries Used • Graphics & User Interface • QA & Testing
  9. 9. Development Tools (Early to Mid 2012) Eclipse • But which one? • Build System: Ant • Dependencies: JAR files or Maven (if you’re patient)
  10. 10. Development Tools (Mid 2012 to Mid 2013) Android Developer Tools (ADT) Bundle • Android specific version of Eclipse • Slightly more lightweight
  11. 11. Build Process - Eclipse & ADT • Initial approach - File > Export, manually enter keystore password, etc. • Slightly better approach - Template based Ant build • Release & debug resources • Custom Ant build targets with config specific tokens • Templates for manifest and other source files
  12. 12. Build Process - Eclipse & ADT Problems with this approach • Non-standard • Templates must be be updated instead of main files (i.e. manifest gets overwritten with populated template on each build) • Switching between release & debug must be done via the command line. IDE just builds current files.
  13. 13. Development Tools (Mid 2013 to Present) Android Studio • Gradle • Maven dependencies - Similar to Ruby Gems
  14. 14. Build Process - Android Studio Gradle • Release & debug resources - automatically merged during build process, no need for templates • Automated signing & version code incrementing for release builds • Automatic upload of test builds to Test Fairy
  15. 15. Gradle Build - Config-Specific Resources android { ! // ... ! sourceSets { debug { manifest { srcFile 'gradle/debug/AndroidManifest.xml' } res { srcDir 'gradle/debug/res' } } ! release { manifest { srcFile 'gradle/release/AndroidManifest.xml' } ! res { srcDir 'gradle/release/res' } } } ! // ... ! }
  16. 16. Gradle Build - Release Signing android { ! // ... ! signingConfigs { release { storeFile file("../my_keystore.jks") storePassword "$up3r$3cr3t" keyAlias "my_key_alias" keyPassword "$up3r$3cr3t" } } ! buildTypes { release { signingConfig signingConfigs.release } } ! // ... ! }
  17. 17. Gradle Build - Version Code Increment def versionMajor = 1 def versionMinor = 0 def versionPatch = 0 ! task('increaseVersionCode') << { def manifestFile = file("src/main/AndroidManifest.xml") def pattern = Pattern.compile("versionCode="(d+)"") def manifestText = manifestFile.getText() def matcher = pattern.matcher(manifestText) matcher.find() def versionCode = Integer.parseInt(matcher.group(1)) def manifestContent = matcher.replaceAll("versionCode="" + ++versionCode + """) manifestFile.write(manifestContent) } ! tasks.whenTaskAdded { task -> if (task.name == 'generateReleaseBuildConfig') { task.dependsOn 'increaseVersionCode' } }
  18. 18. Gradle Build - Version Code Increment android { ! // ... ! defaultConfig { minSdkVersion 14 targetSdkVersion 19 versionName "${versionMajor}.${versionMinor}.${versionPatch}" } ! // ... ! }
  19. 19. Gradle Build - Test Fairy Upload buildscript { repositories { mavenCentral() maven { url 'https://www.testfairy.com/maven' } } ! dependencies { classpath 'com.android.tools.build:gradle:0.10.+' classpath 'com.testfairy.plugins.gradle:testfairy:1.+' } } ! apply plugin: 'android' apply plugin: 'testfairy' ! android { testfairyConfig { apiKey "1234567890abcdef" } } ! ! gradlew testfairyDebug https://github.com/testfairy/testfairy-gradle-plugin
  20. 20. Topics • Development Tools & Build Process • Libraries Used • Graphics & User Interface • QA & Testing
  21. 21. Libraries Used - API (Early 2012 to Mid 2013) • Apache HTTP Client - API requests • Ignition Library - Caching & async image loading • GSON - JSON parsing
  22. 22. Libraries Used - API (Mid 2013 to Present) • Volley - API requests & caching Pro Tip: compile 'com.mcxiaoke.volley:library-aar:1.0.+' • Picasso - Async image loading • GSON & Jackson - JSON parsing • Apache HTTP Components - File uploads
  23. 23. Libraries Used - User Interface • Smooth Progress Bar - Dashed progress bar similar to Gmail, etc. • Sticky List Headers • View Pager Indicator
  24. 24. Libraries Used - User Interface • Butter Knife - View Injection ! ! @InjectView(R.id.profile_username) TextView username; ! @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.my_fragment, container, false); ButterKnife.inject(this, view); return view; }
  25. 25. Libraries Used - Social Networks • Facebook SDK • Twitter4J • Signpost - Twitter OAuth flow
  26. 26. Libraries Used - Miscellaneous • Google Play Services - Battery friendly location • GreenDAO ORM - Much simpler than content providers • Otto - Event bus, pub/sub messaging between components • Crashlytics - Crash reporting & analysis
  27. 27. Topics • Development Tools & Build Process • Libraries Used • Graphics & User Interface • QA & Testing
  28. 28. Graphics & User Interface • iOS design != Android design - But iOS 7 blurred the lines • Retina images - XHDPI • Non-Retina images - MDPI • Icon font - Scalable icons that can be styled as text
  29. 29. Graphics - Using an Icon Font 1. Use Font Awesome web font or your own font for scalable, styleable icons 2. Map font characters in a strings resource file 3. Load font, apply to TextView or Button subclass 4. Set view text to desired character, style, etc. 5. Bask in the awesome ! https://github.com/bperin/FontAwesomeAndroid
  30. 30. Graphics - Icon Font in Layouts <com.FontAwesome.Example.TextAwesome android:id="@+id/text_prost_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/fa_beer" android:textSize="30sp" /> ! ! <com.FontAwesome.Example.ButtonAwesome android:id="@+id/button_kaffee_icon" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/fa_coffee" >
  31. 31. User Interface - Multiple Screen Sizes • Use ActionBarCompat & Nine Old Androids if supporting Gingerbread or lower • Use RelativeLayout where possible to dynamically position views • Dimensions in dimens.xml files, different values directories for various screen sizes • Screen size specific layouts where necessary
  32. 32. Topics • Development Tools & Build Process • Libraries Used • Graphics & User Interface • QA & Testing
  33. 33. QA & Testing - Devices • Too many to test them all • Attempt to test a representative sample • Major manufacturers - HTC/Motorola/ Samsung/Nexus • After Gingerbread support dropped, OS version & OEM customizations are much less of an issue
  34. 34. QA Testing - Process • Bugs & features entered in Pivotal Tracker • Multiple builds delivered for testing each week • Use Test Fairy test session videos to troubleshoot device specific issues • Full regression test of RC build before each release
  35. 35. Vielen Dank! K andydyer.org n @dammitandy g plus.google.com/+AndrewDyer

×