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.

●Download link:

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

Advertisement

Sample 2: New JsRouter sample

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

Sample 3: New NativeImage sample

Advertisement

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:

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

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

●Download link:

Advertisement

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

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

(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