Huawei News

Huawei HarmonyOS 2 adds new 5 sample examples

According to the official data, HarmonyOS 2 adds new 5 samples this week, including the JsFACard example function, the JsRouter example, the NativeImage example, the JsTimer example, and the JsDevice example.

Sample1: Update the JsFACard sample function

Scenario: This example shows the service card function, through which important information of the user application is displayed on the desktop. This time, the function of using cards through shortcut gestures has been added to achieve the purpose of direct service and reducing hierarchical jumps.

Advertisement

●Download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsFACard

Sample 2: New JsRouter sample

Advertisement

Scenario: This example shows that by clicking on the text content, the current page jumps to the specified page. The router interface is used to realize the page jump capability and the transfer of parameters during the page jump process.

●Download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsRouter

Advertisement

Sample 3: New NativeImage sample

Scenario: This example shows how to declare the JNI interface and lock and access or unlock pixel data functions through the JNI interface, and provide access to pixel data and pixel map information through Native_image.

●Download link:

Advertisement

https://gitee.com/openharmony/app_samples/tree/master/native/NativeImage

Sample 4: New JsTimer sample

Scenario: In this example, the system time is set through the systemTime interface, and the timer is set through the setTimeout () function.

Advertisement

●Download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsTimer

Sample 5: New JsDevice sample

Advertisement

Scenario: This example uses the deviceInfo, systemParameter and batteryInfo interfaces to query device information, system attributes, and battery and charging attributes respectively.

●Download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsDevice

Advertisement

There are 25 more Samples integrated into DevEco Studio this week, as shown in the following table:

(Via)

Advertisement
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

Why Your Huawei Phone WiFi Keeps Disconnecting (And How I Fixed It)

Okay, so you're sitting in your favorite café, scrolling through Instagram, and suddenly your WiFi…

3 weeks ago

Huawei Phone Not Charging? 9 Complete Fixes

Your Huawei phone won't charge. You plug it in, nothing happens. Before you panic or…

4 weeks ago

How to Unlock Huawei Phone: Key Methods Without Data Loss

Locked out of your Huawei phone? Don't panic. Whether you've forgotten your password, PIN, pattern,…

4 weeks ago

Huawei Phone Battery Drain Fix: Complete Troubleshooting Guide (2026)

Is your Huawei phone dying in just a few hours? You're not alone. Battery drain…

4 weeks ago

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.…

6 months ago

Huawei Mate 80 series latest Information

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

7 months ago