


A buildConfigField receives 3 parameters: the type of the field, the name of the field, and the value of the field. The build types allow us to define custom fields (buildConfigField) for our application, which we can use to have a differnt URL for each of the environments. The first three are the most trivial to achieve. production sytem -> we can just use the default release build type.The above requirements result in the following build types: In order to let some people test the application before releasing it, we want to be able to distribute versions for the test and stage systems as a beta app via google play. We can also start this service on our local machine, to test the local changes we made on the service or the app.įurthermore, we don’t want to be dependent on a remotely running system or on a locally running service, if we are only improving the android app on parts that don’t interact with the web service. Namely, we have a test system, a staging system, and a production system. We have multiple environments for this service to be able to test it before deploying to production.

Let’s say we are developing a web service and want users to interact with this service via our android app. The default build types don’t need to be declared, but you can declare them in order to extend them with custom config. ProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' release -> for the actual release version of the appĪ freshly created adle, has the following build types defined:.androidTest -> for running device tests.debug -> for development and debugging on devices.Build types:Įach android project comes with some default build types: This post will show you some ways in which you can use this functionality to easily build your app for different environments of remote services and for better local development. This can be predefined config values like ‚debuggable‘, but you can also define your own config values that will be accessible in your application. Different build types in android can be used to build the same application with different configurations.
