Methods and steps of Android multi-channel packaging
This article introduces the methods and steps of Android multi-channel packaging and shares them with you, as follows:
1. Generate signature file
Click build - > generate signed APK:
2. Create a signature
Fill in the red part carefully and remember, and fill in the rest at will
With signatures, I won't elaborate on the packaging of a single app. Specifically, I'll talk about the steps of multi-channel packaging
2. Multi channel packaging
Function: specifically analyze the users of each channel according to different channel values
Step 1:
Add a meta data tag definition in the application tag of androidmanifest.xml
Step 2:
Modify the build.gradle file under the app, and add the productflavors property configuration placeholder in build.gradle
perhaps
After the configuration is completed, the package will find
You can choose different channels to generate different APK files
3. Modify the package name of a channel in multi-channel
4. A channel uses different application names or icons
For example, baidu channel should use its own separate application name and icon
1. Create a folder named Baidu under the SRC directory. The name of the folder here should be the same as the channel name set by. Gradle
2. Create the values - > strings.xml file and create the "fields" app_ The "name" value is the desired application name
3. Xiuwen application icon, create res folder under Baidu folder, and create mipmap hdpi, mipmap MDPI, mipmap xhdpi, mipmap xxhdpi, mipmap xxhdpi, and mipmap xxhdpi under res folder. Different pixel value folders, and copy the icon you want to set as application. Note that the name of the picture here must be consistent with that under main.
5. Automatically normalize APK name
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.