Android Project Combat (35): Multi-channel packaging

Source: Internet
Author: User

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

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.