We need to debug while working on Android applications, include the necessary libraries in the project, follow the documentation and many more. Although it is possible to do these manually, a much more useful solution is now possible, “HMS Core Toolkit”.
In this article, we will examine how the client I wrote for Publishing API client works and its features, which we can use to publish the applications we have developed, which is a nice feature of the HMS world.
What is the Publishing API?
Publishing a mobile application has its own lifecycle. There are 2 ways to publish your application in the HMS ecosystem:
Configuring your application manually via App Gallery Console and uploading it to the site.
Publish using code with the Publishing API
Publishin API is a service that includes many features such as transferring your application to App Gallery through an API, disclosing, updating, publishing details. This service allows you to publish your application through a client if the content of your application is fixed or predetermined, instead of dealing with it manually whenever you want to update your application.
When you create a new client, you should create a page like this:
For package name, you need to enter the package name you used while creating your application. If you do not know or have forgotten, you can learn from the “package” section of your application’s “AndroidManifest.xml” file:
After adding the information to the pub-env.py file, when you run it by running the getAppId.py file under “examples” to test it, you will get an output similar to the following:
This ID is your unique ID information created specifically for your application in HMS system. In almost all requests you make on the API, the API will wait for you to enter this ID as a string query. For example:
Get Application Information
You can easily pull and view the application information as a json through the Publishing API. When you run examples/getAppInfo.py, it will output a json output like this:
Update Application Information
You can easily edit your app’s information in the App Gallery through the Publishing API. You can browse the parameters you can edit from here, I updated the language parameter in examples:
I defined the “update_vals” variable as a dictionary. In other words, you can send all the parameters you want to edit at once through this variable.
Preparing the Application for Different Language in App Gallery
When publishing your application in different countries, you can explain and name it in different languages. For this, you can examine the example in AddAppLanguage.py file. You should add the abbreviation of the relevant endpoint language (see the abbreviations here), the corresponding name and description of the application’s language. When you run the application you will get an output like this:
You can see the details of the language you added via AGC:
Uploading the APK File to AGC
You need to carefully fill the variables in the uploadApk.py file under the examples directory. In fact, installing an APK on the system consists of 3 steps:
Submit a request to the Publishing API, depending on the type of file you upload, to request a custom url to the file
Upload your APK file to Huawei Cloud system via this URL
Associate your uploaded APK file with your application’s project in AGC.
While these are going to be done in the background, all you have to do in the Client is to enter the full path information (make sure that it is signed) on your computer (click for signature control and steps to add it to the AGC side), enter the name of your file and whether you will load it as apk or aab, and upload You can handle the process in one step. The steps I mentioned above in the background will be executed by the script:
We understand from the success message that you have correctly installed the package. When we view whether it is installed via AGC:
Apart from these endpoints I integrate, you can also check out the other features of the Publishing API here: Publishing API
For a while I had a simple idea of timing in mind. Undoubtedly, the days that we all care and look forward to have been. You need a system that you want to write an application for jobs like this, that needs to work constantly in the back and pay attention to time. At this point, WorkManager comes into play and reaches our rescue …
One of the important issues in the world of application development is the acceptable system resource consumption and performance of our application on devices. Where you need a tool for these and similar systemic concerns, I come across APM service. Here, I recommend APM service to the help of developers suffering from this issue…
It’s been 1 year since I started working at Huawei. During this time, I had the opportunity to accumulate many memories and meet very valuable people. When I started working, I had established a warning to myself that I would write such an article at the end of 1 year and I wanted to write down what I saw and lived with this notification recently.