Froyo to kit kat   two years developing & maintaining deliradio
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Froyo to kit kat two years developing & maintaining deliradio

on

  • 175 views

 

Statistics

Views

Total Views
175
Views on SlideShare
148
Embed Views
27

Actions

Likes
0
Downloads
2
Comments
0

1 Embed 27

http://de.droidcon.com 27

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Froyo to kit kat two years developing & maintaining deliradio Presentation Transcript

  • 1. Froyo to KitKat Two Years Developing & Maintaining DeliRadio by Andy Dyer
  • 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. 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. About DeliRadio - Navigation & Filters
  • 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. 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. Topics • Development Tools & Build Process • Libraries Used • Graphics & User Interface • QA & Testing
  • 8. Topics • Development Tools & Build Process • Libraries Used • Graphics & User Interface • QA & Testing
  • 9. Development Tools (Early to Mid 2012) Eclipse • But which one? • Build System: Ant • Dependencies: JAR files or Maven (if you’re patient)
  • 10. Development Tools (Mid 2012 to Mid 2013) Android Developer Tools (ADT) Bundle • Android specific version of Eclipse • Slightly more lightweight
  • 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. 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. Development Tools (Mid 2013 to Present) Android Studio • Gradle • Maven dependencies - Similar to Ruby Gems
  • 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. 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. 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. 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. Gradle Build - Version Code Increment android { ! // ... ! defaultConfig { minSdkVersion 14 targetSdkVersion 19 versionName "${versionMajor}.${versionMinor}.${versionPatch}" } ! // ... ! }
  • 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. Topics • Development Tools & Build Process • Libraries Used • Graphics & User Interface • QA & Testing
  • 21. Libraries Used - API (Early 2012 to Mid 2013) • Apache HTTP Client - API requests • Ignition Library - Caching & async image loading • GSON - JSON parsing
  • 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. Libraries Used - User Interface • Smooth Progress Bar - Dashed progress bar similar to Gmail, etc. • Sticky List Headers • View Pager Indicator
  • 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. Libraries Used - Social Networks • Facebook SDK • Twitter4J • Signpost - Twitter OAuth flow
  • 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. Topics • Development Tools & Build Process • Libraries Used • Graphics & User Interface • QA & Testing
  • 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. 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. 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. 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. Topics • Development Tools & Build Process • Libraries Used • Graphics & User Interface • QA & Testing
  • 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. 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. Vielen Dank! K andydyer.org n @dammitandy g plus.google.com/+AndrewDyer