Harmony OS 2

Huawei HarmonyOS API: Key SDK changes, Java API, JS API, configuration files

Huawei officially launched the Harmony OS on June 2, 2021, its in-house operating system, a replacement for Android. The company announced a new watch – Watch 3 Series, a new tablet – MatePad Pro 10.8 & 12.6, and a new phone powered by HarmonyOS. The company has also shared a list of 100 different Huawei phone models to upgrade with Harmony OS over the next year.

Huawei has two different operating systems that it calls “HarmonyOS.” First is the IoT and smartwatch version of HarmonyOS, which is based on Huawei’s LiteOS and is open source. The second version of Harmony OS is for phones and tablets and is a fork of Android and uses the Linux kernel.

The HarmonyOS API has been continuously expanded and improved, with more available functions and more powerful. But every time the version is updated, developers have to find out which APIs are added in the new version by themselves, which actually takes a lot of time.

Huawei responded that it brought the first API difference report this time. This report is based on API 6. It will provide you with version introduction, key SDK change instructions, etc., including Java API, JS API and configuration files.

Version introduction:

Advertisement

HarmonyOS SDK 2.2 Beta 1 is released this time. Compared with the previous version, please refer to [Java API Difference Report (API 6 -> API 5)] and [JS API Difference Report (API 6 -> API 5)] for API changes.

● Java API difference report (API 6 -> API 5)

https://developer.harmonyos.com/cn/docs/documentation/doc-releases/apidiff-java-api-6-0000001123842928

● JS API difference report (API 6 -> API 5)

https://developer.harmonyos.com/cn/docs/documentation/doc-releases/apidiff-js-api-6-phone-component-0000001170697425

Advertisement

The key changes to the SDK are explained as follows:

❖ Java API part:

◆ Added the StartAbility interface that supports callbacks, which is mainly used in installation-free scenarios to facilitate developers to obtain the callback results of StartAbility.

◆ Added the function of providing background agent timing reminder and related interfaces, which can be used for system reminders of countdown, calendar, and alarm after the application is frozen or exited.

◆ Added the response interface when the provider of the service card receives the notification of the query card status initiated by the card service provider.

Advertisement

◆ Added an interface that provides file sharing capabilities in the application sandbox for sharing files in the sandbox.

❖ JS API part:

◆ div component function changes: the layout of the root node div no longer fills the full screen, but is set according to the size of the child nodes. For details, please refer to [div component function changes].

● div component function changes

https://developer.harmonyos.com/cn/docs/documentation/doc-releases/changelog-api-6-0000001170522589#section292715611144

Advertisement

◆ General style margin function change: When the component has set the percentage width and height and margin at the same time, there will be different layouts in API 5 and API 6. For details, please refer to [General Style Margin Function Changes].

● General style margin function changes

https://developer.harmonyos.com/cn/docs/documentation/doc-releases/changelog-api-6-0000001170522589#section168737911175

◆ Added APIs that provide several subsystems such as meta-capabilities, graphics, files, etc. For details, please refer to the JS API Difference Report (API 6 -> API 5).

❖ Configuration file section

Advertisement

In the configuration file config.json, the configuration method of the version.name and version.code fields have been modified. It is recommended that the application use a four-segment version number and the strong association relationship between the version.code field and the version.name field has been canceled.

(Via)

Min

Min En specializes in smartphone reviews, EMUI/HarmonyOS coverage, and mobile industry analysis. His in-depth knowledge of Huawei's ecosystem, from flagship devices to emerging technologies, makes him a trusted voice in the tech community.

Recent Posts

Huawei Mate 70 Air shows up in a promotional photo

Huawei is getting ready to release a new super-thin phone called the Mate 70 Air.…

3 months ago

Huawei Mate 80 series latest Information

Tipster Digital Chat Station has confirmed that the Chinese tech giant Huawei will release new…

5 months ago

Huawei’s Xu Zhijun steps down as chairman

A Chinese company called HiSilicon Semiconductor just changed who's in charge. The old boss, Xu…

5 months ago

HUAWEI MatePad Mini complete info

HUAWEI has introduced the all-new MatePad Mini tablet, in China. As per the specifications, the…

5 months ago

Huawei Watch GT 6 and Watch GT 6 Pro spotted on TDRA Certification Database

New details have been confirmed about the upcoming Huawei Watch GT 6 and Huawei Watch…

6 months ago

Huawei Nigeria to Host 2025 Job Fair

Huawei Technologies Company Nigeria Limited has announced the 2025 Huawei Job Fair, set to take…

6 months ago