In a brand-new Android Studio project, the default configuration is called the default flavor, but you can define multiple flavors. Each flavor results in creating a unique APK file. There are many reasons for creating multiple flavors, for example, one flavor might be for more recent versions of Android and one for older versions. Or you might have one full version of the app and one demo version of the app.
- [Instructor] There are many situations in which you may want to publish multiple different variations of your application. You've probably seen it before. An app listed on the store twice. One limited, feature-free version and one full-featured paid version. But, how do you do this? Android allows you to define application flavors and build types within your code, which are then combined to create the different build variants, so that you can build multiple APKs from the same source.
In fact, you have been using build variants this whole time without even knowing it yet. Let's start with build types first. In our project in Android Studio, in the project outline on the left, open up the module's gradle file. You should have a defaultConfig block and a buildTypes block with a release block within it. By default, Android Studio automatically generates a release build type, which you used to build your production-ready APK, that has debugging turned off and was minified and protected with ProGuard.
It also automatically generates a hidden debug build type that has debugging turned on. You can add the debug build to your gradle file if you would like, to make any configuration changes to it. There is a detailed reference to all of the properties you can configure for build types, here.
- Exploring the distribution options
- Cleaning up your code
- Building a signed APK file
- Configuring build types and variants
- Distributing through Google Play
- Adding app graphics
- Setting pricing
- Publishing the app in Google Play
- Submitting an app to Amazon
- Tracking app use in Google Play and Amazon