Android Project Practice (35): multi-channel packaging and android practice
Multi-channel packaging:
It can be understood that multiple channels of apk are released at the same time. Different app stores are available. These apk tags are used to calculate and analyze the download times and other data of each store.
Steps
1. Add umeng channel tags
Add location: AndroidManifest. xml file under the app directory
Add statement:
<! -- Multi-Channel packaging --> <meta-data android: value = "$ {UMENG_CHANNEL_VALUE}" android: name = "UMENG_CHANNEL"/>
Example:
2. Add Channels
Add a few packages. You can generate packages from several corresponding channels during packaging.
Add location: In the android {...} file of build. gradle under the app directory
Add code:
productFlavors { xiaomi {} qihu360 {} baidu {} wandoujia {} } productFlavors.all { flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name] }
Example:
Iii. Signature information configuration
The above packages are all unsigned. Signature packages are required for mounting.
Implementation:
Add signingConfigs {...} to android {...} in the app directory.
4. Set the signature to release.
Add location: In the android {...} file of build. gradle under the app directory
Add code:
signingConfig signingConfigs.release
V. gradle multi-channel Packaging
Test:
You can see that outputs --> the app has multiple release.apk packages.