droidcon thessaloniki 2015
TRANSCRIPT
Topics
1. Zalando2. Our Google Play Release Panic3. An Internationalization Problem4. User Country Problem5. App Deep Link6. Choosing a library
One of Europe's largest online fashion retailers
15 countries3 fulfillment centers16+ million active customers2.2+ billion € revenue 20149.000+ employees
About Zalando Tech
● Tech HQ in Berlin● Four other tech offices, including Helsinki and Dublin● +800 technologists ● Nearly everything produced in-house● 135+ million visits per month (57% come from mobile
devices)
Special Thanks to “#guild-fuckup”
Valentine Gogichashvili● Head of Data Engineering● Creator of “#guild-fuckup”
on HipChat
Play Store Release: The Context
After one week of testing and bugfixing:100% Tests OK. QA team gave the go
The new app version was staged rollout at 50% of our users right before a long weekend.
Chronology
● 19h We noticed all app start will crash after an update.
● Issue escalated. Boss arrived .● Call to Google. Sorry Google cannot revert for
you.○ hotfix ( identify the cause first )○ create a new .apk
What Google says
Note that rollbacks aren’t supported due to the app versioning requirements of the Android platform.If you need to rollback, consider launching a previous APK with a new version number.
Understand App Versioning
Make sure that each successive release of your application uses a greater versionCode value.
NewVersion.versionCode < Rollback.versionCode
versionCode
201 202 203
Rollback Strategy
versionCode(internal)
2.3 (Old version) 2.4 (New version)
versionName( String visible to user)
101 102100
Rollback Strategy
versionCode(internal)
2.3 (Old version) 2.4 (New version) 2.3.1 (Rollback)
versionName( String visible to user)
101 102100
Rollback is built from the code base of the Old Version
Play Store Release: Lessons
- Cause of the crash : One column was renamed in the app’s SQLite database
- Always test an app upgrade- Have a rollback .apk ready - Never publish before weekends or public holidays- Limit the potential damage by starting the staged rollout
How this would work on iOS
- No staged rollout- No app rollback strategy- Expedited App Review ( Urgent Bug Fix ) takes
minimum 19 h ( without rejection)
When to celebrate a Release
Celebrate on the release day OR after user reviews
Celebrate a release one week after . It depends on the length of release cycle ( 6 week cycle )
Internationalization: The Context
We’re in 15 countries—but not Russia
● If the device is in Russian, Zalando’s app title was “Barcode scanner”
Internationalization
Why “Barcode Scanner?”
● We use libraries with resources: apklib, aar
● The apklib, aar library overrides our strings
app_name library’s app_name
en zalando barcode scanner
de zalando barcode scanner
ru barcode scanner
Internationalization: Lang
The locales (res/values-xx/strings.xml) are two-letter ISO 639-1 language
26^2 = 676 possibilities
You don’t have to cover all languages
Internationalization: Solutions
● app_name is the default key for the name. Rename app_name to company_app_name
● Make sure there is no key name collision
Solution Res Configs
http://tools.android.com/tech-docs/new-build-system/resource-shrinking
android { defaultConfig { resConfigs "en", "fr", "de", "gr" // languages targeted }}
A User Country Problem
Source
User Country: The Context
Device locale is NOT the same as the country where the user lives ( country of delivery )● Example: My phone is in English, but I live in Greece
Solution IP geolocation
You can resolve with IP geolocation.
But there are some edge cases , the user :- is roaming- lives in a country border
Solution IP geolocation
You can resolve with IP geolocation.
But there are some edge cases , the user :- is roaming- lives in a country border- uses a VPN
User Country: Solution 1
Mobile: you infer the user’s country by using the TelephonyManager
import android.telephony.TelephonyManager;….telephonyManager.getNetworkCountryIso();
Deep Link
Source
App Deep Link
App deep linking refers to a URL that points to a specific part of an app ( onboarding )
Use cases1. Link Web to App2. Link App to App3. Push Notifications , Ad Campaigns , Referral Programs ...
Error with deep links from developers
The application syncs data at initial setup phase. Loading with a Splash screen.
Splash is the entry point for all target Activities.Don’t forget to load the Splash.
Error with deep links
Take care how the deep links are used ( onboarding , home )Create a good documentation.
Deep Links are powerful API.Check how a third party would use them.
Choosing a Library
Source
Open source libraries
Commercial productsnot always your choice ( boss, budget … )
Open sourceDevelopers choose the best tool
Criteria
1. Is the API to your liking?2. Maturity level3. How well documented is the project? 4. Is the project "famous"?
Select Your Library: Lessons
What is best for X may not be for you. Do you own research.
- Always benchmark the available libraries
- Don’t let fanboy/girlism cloud your judgment
Libraries memory use
loading time ...
Picasso
Glide
Ion
Universal Image Loader
Volley
Refactoring: Some Best Practices
DO1. no behavior change (100% unit tests success)2. measurable improvement—strengthen the argument for
refactoringDON’T1. refactor without a set of tests in place
from Roboguice to Dagger 2
The library of Dependency Injection was good at that time.
Now something new came out. It made its proof.
Cannot be incremental refactoring . Must be done in one Go.
Arguments to switch from Roboguice to Dagger 2
Roboguice uses reflection ( runtime )Dagger 2 is based annotation processing ( compile time )
Performance-wise : Dagger 2 is much better than Roboguice
Big Refactoring: Lessons
● The better you prepare for changes, the fewer problems afterward
● Make sure everything compiles.
will take a photo in Greece
Raymond Chenongoogle.com/+RaymondChenontwitter.com/raychenon raychenon.com
Thank you!droidcon Greece Thessaloniki
About Zalando
Tech Blog: tech.zalando.comGitHub: github.com/zalando
Twitter: @ZalandoTechInstagram: zalandotech
Jobs: http://tech.zalando.com/jobsRefer: [email protected]