Original: Android Project Combat (35): Multi-channel packaging
Multi-Channel Packaging:
It can be understood as: APK that publishes multiple channels at the same time. Different app stores are listed separately. These apk are tagged with their own channels for statistical analysis of the number of downloads and other data for each store.
Implementation steps
First, add Friends channel tag
Add Location: Androidmanifest.xml file in App directory
To add a statement:
<!--multi-channel packaging-- <meta-data android:value="${umeng_channel_value}" android: Name="umeng_channel"/>
Example:
Second, add channels
Add a few, and when you pack it, you can generate several packages for the appropriate channel.
Add Location: Build.gradle file in App directory android{...}
Add code:
productflavors { Xiaomi {} qihu360 {} Baidu {} Wandoujia {} } Productflavors.all { -flavor.manifestplaceholders = [Umeng_channel_value:name] }
Example:
Third, the signature information configuration
The above-mentioned packages are unsigned. A signature package is required on the shelves.
Realize:
Add signingconfigs{...} in the app directory android{...} related.
Iv. designation of the signature as release
Add location: Within the app directory Build.gradle file android{...}
Add code:
Signingconfig Signingconfigs.release
Five, Gradle realize multi-channel packaging
Test:
You can see the release.apk package for each channel in outputs---app
Android Project Combat (35): Multi-channel packaging