Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Amejia481/5acfac15e63368624bbe242e3dc3806d to your computer and use it in GitHub Desktop.

Select an option

Save Amejia481/5acfac15e63368624bbe242e3dc3806d to your computer and use it in GitHub Desktop.
Snippets for the talk Best Practices to Slim Down Your App Size (Google I/O '17) video https://youtu.be/AdfKNgyT438?list=PLWz5rJ2EKKc-odHd6XEaf7ykfsosYyCKp
/**
Use Proguard
Video section: https://youtu.be/AdfKNgyT438?list=PLWz5rJ2EKKc-odHd6XEaf7ykfsosYyCKp&t=413
**/
android {
buildTypes {
release {
minifyEnabled true
}
}
/**
Build Multiple APKs
Video section: https://youtu.be/AdfKNgyT438?list=PLWz5rJ2EKKc-odHd6XEaf7ykfsosYyCKp&t=665
**/
android {
splits {
density {
enable true
}
}
}
/**
Use Vector Drawables
Video Section: https://youtu.be/AdfKNgyT438?list=PLWz5rJ2EKKc-odHd6XEaf7ykfsosYyCKp&t=745
**/
android {
defaultConfig {
vectorDrawables.useSupportLibrary true
}
}
/**
Exclude Sparse Translations
Video Section: https://youtu.be/AdfKNgyT438?list=PLWz5rJ2EKKc-odHd6XEaf7ykfsosYyCKp&t=884
**/
android {
defaultConfig {
resConfigs "en"
}
}
/**
AAPT2(Android Asset Packaging Tool)
Video: https://youtu.be/AdfKNgyT438?list=PLWz5rJ2EKKc-odHd6XEaf7ykfsosYyCKp&t=1301
Try AAPT2 now:
File gradle.properties
**/
android.enableAapt2 = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment