

The "free" version will be named as "My Free App" and "pro" app will be named as "My Pro App". This way, the application ID for the "free" product flavor is "" and for "pro" it will be "" because the applicationId will be suffixed by "free" and "pro" (by using applicationIdSuffix) respectively and so as the application ID differs due to this suffix, there will be two instances of the same app in your device pointing to different environments!Īlso, one thing to note, the two apps will have different app names as well. ResValue "string", "app_name", "My Pro App" ResValue "string", "app_name", "My Free App" For each flavor inside the productFlavors block, you can redefine the application ID property, or you can instead append a segment to the default application ID using applicationIdSuffix, as shown here: In this case, each build variant should be defined as a separate product flavor. However, if you want to make multiple versions of your app to appear as different listings on the Google Play Store, such as a "free" and "pro" version, then you need to create separate build variants so that each have a different application ID.

The answer is simple, through different build variants.įor the APK,the application ID is tagged with the APK by the build tools defined in the defaultConfig block from the adle file (as shown below). Now the question arises, as to how to define the multiple application ID of the same application? So, basically if we define multiple application ID according to different instances, it will result in having multiple APKs of the same app in the same device without changing or switching the user, which is not what we need. Your application ID is defined with the application ID property in your module's adle file, as shown here: While developing one of the apps for a client, I felt the need of one necessary requirement which was to install two or more instances of the same app in your Android phone without creating a new user or pointing to different servers.īut, before we move on to understanding how to install multiple variants of the same app in your phone, let's see what is an Application ID in an Android build system.
