Why Should We Use the App Bundle?
Release App Bundle on AppGallery

Mehmet Batuhan Ulper
Huawei Developers
Published in
5 min readDec 18, 2020

--

When we want to release Android projects, there are two distribution options.
generate app bundle or generate signed apk.

Although it is the app bundle that comes selected, most of us have to make an extra click and use the first usual method the generate signed apk. This method may seem more reasonable to share the app with a small pool of users without distributing it to any store.
But if your application appeals to large audiences in the store, using app bundle becomes more and more inevitable. So what is the app bundle and what is the difference?
Let’s take a look at these now

Faster installation, Less disk space!

APP Bundle
The apk file contains all the files and codes of the project. It has a certificate stating that it is signed. If we are distributing to the market with the .apk file, this certificate is very critical. This certificate must be retained for implementation purposes (eg update).
An apk file collects the project’s available resources (audio, video, photo, mandatory data) in one package. It does not accommodate Dynamic Features or Assets device group specific.

Reduced APK Size
When you publish your applications using application packages, you can reduce the size of your application, simplify versions, and enable advanced distribution features.
Application packages use a publishing model called Dynamic Delivery to create and publish APKs optimized for each device configuration.
Thus, it offers users more efficient applications.
This way, you only need to create, sign and upload a single build to support APKs optimized for a wide variety of device configurations.

So, can we use the app bundle on AppGallery?
Yes, you can distribute your application with the app bundle in the AppGallery, and you can move your existing apk to the app bundle.
Let’s see how to do this.

Publishing App Bundle in AppGallery

To release our project as app bundle on AppGallery, we must first create the app signing file on the AppGallery console.

AppGallery Connect provides you with two signature creation methods:
1. Let AppGallery Connect to create and manage my app signature key (recommended);
2. Export and upload the key and certificate. The first one is recommended. If it is unavailable, use the second method. Note that,
usepepk.jarfound over the Internet instead offrom Android Studio to export and upload the key and certificate.

In this article, I will add an app signing file using the method suggested in the first item.
If you want to add as in the 2nd way, I recommend you to read the following article

For generate signed bundle continue
If you already have a keystore file you can continue with that. If you don’t have you should create a new
Choose your variant and generate your signed bundle

After generating the signed app bundle, we click on 1 to access the aab file, and 2 to access the exported key file. Click on the area specified in 2 and go to the file location where our private key was created. Open power shell in here and run the command below.

$ keytool -export -rfc -keystore upload-keystore.jks -alias upload -file upload_certificate.pem

Not:Parameters in bold must be replaced as needed.

Click on browse and add the upload certificate and click to submit button.

Our application signature certificate is ready now, we can go to version control and add our app bundle and release it. If the signature key uploaded to AppGallery Connect is different from that of the released app, the new certificate fingerprint may be different from that generated locally during app development. If the services you are integrating need to depend on the SHA-256 certificate fingerprint, you need to add the new SHA-256 certificate fingerprint for your app.

For the release our bundle go to version information section

And add your generated signed . aab file to here. To find the bundle file, you can click the link indicated with 1 above and access the .aab file.

Final

Now you can publish your application as an app bundle. In this way, you can reduce the update sizes of your existing applications and provide a better experience to the end user.
It is very tempting for developers to repeatedly delete and install the entire package after each development.
I hope this article will be useful to developers who want to use app bundle and want to publish their app as app bundle in AppGallery.

Thank you for reading!

Resources

--

--