Gradle is the build tool which is used by android studio. When I was started developing android application I does not try to change anything inside build.gradle file and I kept as it is. But now I know that can be use to improve our development life.

1.Build Types

When we are developing application we have to manage development app, release app , beta release app separately. May be each of these app have different configuration. In early day what I was did is I maintained a config file and when we do different release I change the config variable based on the release. Actually we do not need to do that kind of changes to config file when we are building dev or release app. What we can do is we can define all config in the build.gradle file itself.

3. Resource Values

Same as the custom field values we can define resource values inside build.gradle file. I used this lot when I was integrating Admob to the app. In Admob we cannot use our real adsId to testing purposes. In that case Admob provide testing AdsId. Therefore we can define two resValue inside release and debug config. Inside release config we can add real AdsId and inside debug config we can add test id.

4. Extra properties

When we are using support design library in android it’s good to use same library version. If not there can be some error occur if there is incompatibility happen. Also when I am developing a app I will define app version as a ext and It will easy to update the app version in the single place.