HUAWEI Wireless Kit

Hakki Ozer
Huawei Developers
Published in
8 min readOct 16, 2020

Hello everyone, I will explain what is the wireless kit and how to use it in your apps. Huawei Wireless Kit is a service to evaluate the quality of wireless and wifi connection according to round trip time and the location of mobile phone. Wireless Kit can be use in more than 230 countries and regions, and supports dozens of languages. You can integrate the Wireless Kit into your apps easily.

With the help of the article, you will learn the uses cases which show how to use the wireless kit.

In which scenarios can we use the Wireless Kit?

Wireless kit can be used for application to provide some facilities and analysis like network QoE, application transmittion quality feedback, weak signal prediction and analysis for Wi-Fi high priority. Now I will give some details for these facilities with scenarios of Wireless Kit below.

Network QoE information

In network QOE information use case, the algorthim takes the round trip time(RTT) and calculates uplink and downlink air interface delays during data transmission, real time bandwidth, the uplink and downlink air interfaces’ rate, network QoE level assessmentand packet loss rate of the uplink air interface. With the help of the datas, Wireless kit gives network quality of experience service and provides many facilities for applications.

  • App transmission quality feedback

Information such as transmission delays and statistics is sent from applications by the Wireless kit. Therefore, planning adjustments can be made by the communication module to increase the wireless communication quality of applications. Apps send information such as transmission lags and transmission statistics to the wireless communication module through Wireless Kit. Therefore, the communication module can make scheduling adjustments accordingly to improve the wireless transmission efficiency for the apps. For example, if there are problems such as freezing in a video conversation, this problem will be reported to the wireless communication module via the wireless kit. The communication module records the information about the problem and improves the transmission capacity according to the current network.

  • Weak signal prediction

During the movement of a user moving along a certain route, the cellular network signal quality is analyzed by the wireless kit using machine learning. According to the analysis results, the users’ entry times to areas with weak signals and normal signals are calculated. In this way, it offers signal quality calculations in order for third-party apps to proceed according to the signal quality.

  • Wi-Fi high-priority transmission

Wireless SDK can be integrated into your application to use Wi-Fi development services. Wi-Fi high priority transmission can be enabled after Wi-Fi enhancement services are registered with your app.

Getting Started

In this part, I will share restrictions like supported devices, supported locations, hardware and software requirements. Also, you can find more detail for Wireless Kit on the link below

https://developer.huawei.com/consumer/en/hms/huawei-wirelesskit/

Restrictions

Supported Devices

You can check the features of the mobile phones from the table below.

Note: If you use wireless kit using Wi-Fi, you need a mobile phone that has EMUI 11.0 and Kirin 990 Chipset. If you want to use wireless kit using cellular connection, you need minimum EMUI 10.1 and Kirin 990 Chipset. If you don’t use mobile phones with the features, your app will work but will not give a result.

Supported Locations

Wireless Kit can be used in more than 200 countries on the world. You can see the Supported Locations in the link below.

https://developer.huawei.com/consumer/en/doc/HMSCore-Guides-V5/region-0000001050715052-V5

Hardware Requirements

  • A computer (desktop or laptop) running Windows 7 or Windows 10
  • A Huawei phone (with the USB cable), used for debugging

Software Requirements

  • Java JDK 1.8 or later
  • Android Studio 3.X
  • Android (API level 21 or higher)
  • HMS Core (APK) 5.0.1.300 or later

Required Knowledge

  • Android app development basics.
  • Basic QoE knowledge in cellular and Wi-Fi networks.

Preparations Before Development

Before you start to apps development , you should apply some steps to your own project. the following preparations:

  • Create an app in AppGallery Connect.
  • Create an Android Studio project.
  • Generate a signing certificate.
  • Generate a signing certificate fingerprint.
  • Configure the signing certificate fingerprint.
  • Add the app package name and save the configuration file.
  • Add the AppGallery Connect plug-in and the Maven repository in the project-level build.gradle file.
  • Configure the signature file in Android Studio.

You can follow the link below for the steps above.

https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html#0

  1. Configurations for Integrating HUAWEI HMS Core Section

As in other Huawei kits, there are some configurations you need to do some steps like creating an app in AppGallery Connect for the Wireless kit. You can follow the link below to do these steps.

https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html#0

2. Wireless Kit SDK Integration

You need to download and add SDK into your application for Wireless Kit.

1. Firstly, you need to sign in the AppGallery Connect then you click my projects. Then, find your app project and click your app which need HMS Core SDK integration. Thirdly, you need to go to Project Settings and then click Convention. In this point, you need download agconnect-services.json and copy it to your project’s app’s root directory in your Android Studio.

2. Secondly, you need to add the AppGallery Connect plug-in and the Maven repository in the project build.gradle file. You can do it using the lines below.

2.1. Thirdly, you need to configure the Maven dependency in the app-levelbuild.gradle. You can check it below.

2.2. Then you need to apply plugin in the file header. For this section, you can add the following configuration to the next line of ‘com.android.application’.

2.3. Add build dependencies in the dependencies section.

3. In this point, before building the APK, you need to configure the obfuscation configuration file to prevent the HMS Core SDK from being obfuscated. The obfuscation configuration file is proguard-rules.pro for Android Studio.

To configure obfuscation configuration file:

  1. Open the obfuscation configuration file of your project.
  2. Add configurations to exclude the HMS Core SDK from obfuscation

3. If you are using AndResGuard, you need to add it to the allow list in the obfuscation configuration file.

Now I will explain how to connect the service corresponding to the Android Interface description language (AIDL) API, IQoEService to quickly access the wireless kit and receive network QOE feedback.

Development Process

1. Service binding

At this point, we first get a NetworkQoeClient object. Then we call GetNetworkQoeServiceIntent and connect our application to IQoeService. If GetNetworkQoeServiceIntent does not get results, your application will not be able to use IQoeService.

2. Callback registration for network QoE information

Now, we will register the network QoE information callback. The callBack includes the parsing of key network QoE data.

The network QoE information callback is recorded, and the CallBack includes parsing the key network QoE data.

Then unregister the Network QoE callback record. Make sure that the CallBack is the same as at the time of registration. With the deletion of the record, the application’s callBack process will not be applied.

Get real-time QoE information like uplink round trip(uLRtt),downlink round trip(dLRtt), uplink and downlink bandwidth and rates.

3. Service unbinding

Unbind your app from IQoeService using the line below.

Test for Wireless Kit

In the picture below you can see the interface of the apk that we created to test the wireless kit. We created 3 scenarios for Wireless Kit but we will analyze only network QoE. When you open the wireless kit app you will see the screen below. First, we will click NETWORKQOE button

Secondly, you will see the page below. On this page, you need to click “BIND SERVICE” button then if you see “Connected” near the button, click “REGISTER CALLBACK” button. If the result is “0”, it means that register callback registeration function is working correctly. Then A string of characters such as numbers, commas, and minus signs will be displayed in the TextView on UNBIND SERVICE.

The values between 1 and 4 on the image above mean identifier, uplink delay, downlink delay, uplink bandwidth, downlink bandwidth, uplink speed, downlink speed, QoE level, and uplink packet loss rate respectively. Also the value 0 indicates that there is no valid channel.

Then click the “QUERY REAL TIME QOE” button. You will see the results on the line below the “QUERY REAL TIME QOE” button.

Click “UNREGISTER CALLBACK”. If the value 0 is displayed in the TextView, it indicates that the callback unregistration is successful. At this time, the value 0 will be displayed in the TextView above UNBIND SERVICE.

Click “UNBIND SERVICE”. Disconnected will be displayed in the TextView next to BIND SERVICE.

Sample Code for APK

You can find the sample apk code using the link below. You can understand how to use Wireless Kit clearly.

Also you can find a demo kit using the link below.

FAQs

You may find FAQs about Wireless kit on the link below.

Thank you for taking your time and reading my article. Hope to see you in my next medium article.

--

--