Jirawat Karanwittayakarn
LINE Thailand / Developer Relations Team
Explore new strategies to increase your developer productivity with practical tips on how to accelerate your own Android Gradle builds and generate optimized APKs by Android Studio
4. YOUR DAILY LIFE ASSISTANT
FOOD
DELIVERY
CONVENIENCE
GOODS DELIVERY
MESSENGER
SERVICE
POSTAL / PARCEL
SERVICE
TAXI
5. JOINED DEVELOPER BUILD CLINIC
● Developer Build Clinic is one on one consulting
in build performance improvement provided by
Android Studio Team
● Have been part of it since 2016
● Throughout the years I have gathered tips and
advises from the team
11. Tip 2: Add just
Dependencies Needed
$ ./gradlew app:dependencies
12. android {
splits {
density {
enable true
// Specifies a list of screen densities Gradle should not create multiple APKs for.
exclude 'ldpi', 'mdpi'
// Specifies a list of compatible screen size settings for the manifest.
compatibleScreens 'small', 'normal', 'large', 'xlarge'
}
}
}
Tip 3: Build Multiple APKs for Screen Densities
13. android {
splits {
abi {
enable true
reset() // By default all ABIs are included, so use reset() and specify that you only want
// Specifies a list of ABIs that Gradle should create APKs for.
include 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a'
universalApk false // Specifies that we don’t want to also generate a universal APK that includes all ABIs.
}
}
}
Tip 4: Build Multiple APKs for ABIs
14. android {
defaultConfig {
...
ndk {
abiFilters 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a'
// armeabi, mips and mips64 has removed since NDK r17
}
}
}
Tip 5: Build an APK with Specific ABIs
17. Tip 8: Use
Shape Drawable
• Support rectangle, oval, line and
ring shapes
• Support gradient, rounded corner
and outline stroke effects.
18. Tip 9: Use WebP
• Up to 30% smaller than PNGs
• Opaque - API level 15+
• With transparency - API level 18+
19.
20. Tip 10: Use VectorDrawable
• Smaller than Bitmaps
• Resize for different screen densities
without loss of image quality
• API level 21 and higher
• API level <= 20 (use the Support Library)
22. TECHNIQUES FOR
BUILDING
LINE MAN DRIVER APP
FASTER
Knowledge from Developer Build Clinic by Android Studio Team
and “Speeding Up Your Android Gradle Builds” (Google I/O ’17)