Android Studio Multi-channel packaging

Source: Internet
Author: User

The multi-channel packaging described in this article is based on the AU statistical implementation.

Steps for multi-channel packaging:

1. Setting dynamic channel variables in Androidmanifest.xml

<meta-data
Android:name= "Umeng_channel"
Android:value= "${umeng_channel_value}"/>

2. Set productflavors in Build.gradle

Batch modification is used here:

Android {

productflavors {
Default_channel {}
QQ {}
Weixin {}
WEIBO {}
Wandoujia {}
_360 {}
Yingyongbao {}
Xiaomi {}
Baidu {}
Huawei {}
Jifeng {}
}
Productflavors.all {Flavor
Flavor.manifestplaceholders = [Umeng_channel_value:name]
}

}

The so-called productflavors is actually a definable product feature, and when used with manifest merger, it is possible to achieve multiple versions with their own feature configurations during a single compilation. The function of the above configuration is to produce different umeng_channel_value values for each channel package.

3. Packing operation
Here are two methods:
Only graphical interface operations are described here.
In the Androidstudio menu bar, click the Build menu –>generate signed apk–> Select key and enter the password

Then next, select the packaging channel (multiple options available)

Finally click the Finish button


As you can see, we have successfully set up three channel packs.

Android Studio Multi-channel packaging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.