Android Project Practice (35): multi-channel packaging and android practice

Source: Internet
Author: User

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.

    

 

      

 

Related Article

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.