Nowadays, for all of Android developers, Gradle is a word which already quite familiar. But some of us still don’t know about it actually. In this article, I will try to share some of Gradle things that Kudo use for building our Lovely Kudo Android App.
Here is a bit technical definition from “Getting Started With Gradle“. Petri Kainulainen. Retrieved 26 March 2016., Gradle is an open source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration.
2. Google Android studio Goals of using Gradle
From the website http://tools.android.com/tech-docs/new-build-system/user-guide, we can know some purposes of using Gradle on Android Studio:
– Make it easy to reuse code and resources
– Make it easy to create several variants of an application, either for multi-apk distribution or for different flavors of an application
– Make it easy to configure, extend and customize the build process
– Good IDE integration
3. Basic configuration/Installation
If you use Android Studio, no configuration needed because the Gradle is already integrated with it. But, if you really want to install the Gradle to run it manually without dependent with any IDE. You can follow this complete instructions on gradle site: https://gradle.org/install to install Gradle and here is a link video of short configuration on Gradle : https://www.youtube.com/watch?v=2q7XGuH2Q-s
4.Feature of gradle and Kudo implementations
Gradle has many great features to help, improve our build system to create Android Apps. You can find it on : https://gradle.org/maven-vs-gradle, On this article, we will see one of it, it is Custom Build Configurations. With gradle and android plugin, we can customize our build configuration with some of combinations, such as:
– Build types : Build types define certain properties that Gradle uses when building and packaging your app, and are typically configured for different stages of your development lifecycle. For example, the debug build type enables debug options and signs the APK with the debug key, while the release build type may shrink, obfuscate, and sign your APK with a release key for distribution. You must define at least one build type in order to build your app—Android Studio creates the debug and release build types by default.
On our Kudo Android app development, we use 4 build types: Release for production / playstore release version, Beta for internal kudo distribution, debug is for testing combined with alpha version to enable us to switch from development server and staging server.
– Product Flavors: Product flavors represent different versions of your app that you may release to users, such as free and paid versions of your app. You can customize product flavors to use different code and resources, while sharing and reusing the parts that are common to all versions of your app. Product flavors are optional and you must create them manually.
Kudo Android App Product Flavors.
For now, we only have two flavors of sourceset, we use regular flavor sourceset and ramadhan sourceset for Ramadhan month.
Figure 3. Kudo Android App Splash screen, Reguler (left) Ramadhan (right)
Development is getting easier and more awesome with this amazing build tool, Gradle.
Please have a look into our wonderful app, Kudo Android App → https://play.google.com/store/apps/details?id=kudo.mobile.app&hl=en , Thanks 🙂