2. 2
HELLO!
My name is Sergii Zhuk
• Android Developer @ Zalando SE
• Author of DOU.ua Android Digest
• In Berlin since August 2015
• twitter.com/sergiizhuk
• medium.com/@sergii
3. 3
ZALANDO SE
• Europe’s leading online fashion platform
• ~ 10,000 employees in Europe
• ~ EUR 3bn revenue in 2015
• ~ 60% of shop traffic came from mobile
• 10M+ downloads Android app
8. 8
ANDROID STUDIO – TIP 1
How often to update your IDE version?
• Use two installations: stable and canary
• Enable auto-update for the relevant channel
9. 9
ANDROID STUDIO – TIP 2
How to make a code review?
Switch between branches could be slow:
•stash your changes
•checkout branch
•reload gradle config
10. 10
ANDROID STUDIO – TIP 2
How to make a code review?
Switch between branches could be slow:
•stash your changes
•checkout branch
•reload gradle config
• Launch two IDE instances: one for the review, another one for the main work
• Yes, you will need a powerful machine
19. 19
ANDROID STUDIO – TIP 5
Fast preview & build
JRebel
• Multidex only in expensive “Business” version
• 21-day trial
20. 20
ANDROID STUDIO – TIP 5
Fast preview & build
JRebel
• Multidex only in expensive “Business” version
• 21-day trial
Instant Run
• minSdkVersion 15+, 21+ recommended
• Free & accepted by community
22. 22
TEST DEVICES – TIP 1
A lot of UI issues could be discovered if compare app on Lollipop and pre-Lollipop
devices
23. 23
TEST DEVICES – TIP 1
A lot of UI issues could be discovered if compare app on Lollipop and pre-Lollipop
devices
• Use at least two emulator instances or devices during dev tests
• Use both 4.* and 5+ OS versions
25. 25
TEST DEVICES – TIP 2
Emulators question
Genymotion
• Free only for private use & limited functionality
• Latest OS version with the delay
26. 26
TEST DEVICES – TIP 2
Emulators question
Genymotion
• Free only for private use & limited functionality
• Latest OS version with the delay
New Android SDK Emulator
• push apps/data 10x faster than to a device
• includes Google Play Services built-in
40. 40
DEV & ENVIRONMENT – TIP 1
Support Annotations are your friends
• Metadata annotations you can decorate your code with, to help catch bugs
• Dependency 'com.android.support:support-annotations:23.3.0‘
• Integrated with Android Studio & Lint
42. 42
DEV & ENVIRONMENT – TIP 2
How to read logcat output from your device?
• Jake Wharton’s pidcat
43. 43
DEV & ENVIRONMENT – TIP 3
Click on device/emulator screen every time you are testing some functionality
• BUT what if you have 5 test devices?
• AND you have a regression plan for 30 scenarios?
44. 44
DEV & ENVIRONMENT – TIP 3
Click on device/emulator screen every time you are testing some functionality
• Use ADB commands/scripts to replace manual interactions
adb shell input keyevent 4
45. 45
DEV & ENVIRONMENT – TIP 3.5
Click on device/emulator screen every time you are testing some functionality
• Use adb-ninja script to submit your command to several devices simultaneously
https://github.com/romannurik/env/blob/master/bin/ninja-adb
47. 47
DEV & ENVIRONMENT – TIP 4
Think about application tracking
• A lot of projects with overlapping functionality:
• Google Analytics
• Adjust
• Answers Events by Fabric
• Integration requires huge architecture effort
• Testing is always hard
49. 49
DEV & ENVIRONMENT – TIP 5
Network output logging/analyzing
Use Http Monitoring & Proxy tools like Charles
• HTTP/HTTPS traffic monitoring
• Rewrite values
• Set breakpoints
54. 54
GRADLE HACKS – TIP 1
Check your config
build.gradle:
• Get rid of mavenCentral, use jcenter
• Check Gradle plugin version
• DON’T specify version ranges for the dependencies
55. 55
GRADLE HACKS – TIP 1
Check your config
gradle.properties:
• org.gradle.daemon=true
• # if multiple modules:
org.gradle.parallel=true
60. 60
GRADLE HACKS – TIP 3
Build faster using target API 21 for dev needs
productFlavors {
// Define separate dev and prod product flavors
dev21 { minSdkVersion 21 }
dev14 { minSdkVersion 14 }
prod {
// The actual minSdkVersion for the application.
minSdkVersion 14
}
}
62. 62
CONCLUSION
• Keep optimizing time spent on repeating things
• Keep looking for ways how to build app faster
• It’s never too late to improve tools knowledge