The core of setting up the software is that the setting ApplicationID is different, because Android takes the ApplicationID as the process identity and must be unique, it only needs to be changed dynamically when packaging.
1. Setting the Build.gradle productflavors
productflavors {
Office {
ApplicationID"Com.example.app"
Buildconfigfield' String ',' Api_url ',' "http://www.baidu.com" '
Resvalue"string","App_name","App_office"
}
Other {
ApplicationID"Com.example.app.other"
Buildconfigfield' String ',' Api_url ',' "http://www.google.com" '//buildconfig.api_url Way Reference
Resvalue"string","App_name","App_other"The app name can be dynamically configured in the Android manifest file by referencing it in @string/app_name mode
}
}
2. Execution of Gradlew Assembledebug
The debug installation package is generated under app-build-outputs-apk.
From for notes (Wiz)
Android uses Gradle implementation APK software multiple open