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

Advertisement

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:

Advertisement

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:

Advertisement

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:

Advertisement

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

Sample 4: New JsTimer sample

Advertisement

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

●Download link:

Advertisement

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:

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:

Advertisement

(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

Huawei & Angola Partner for Smart Grid Transformation & Green Energy

Imagine a future where a national power grid acts more like an organic, self-healing computer…

1 day ago

Huawei Mate 90 Series Sales Date: Flagship Timeline Revealed Early

Huawei Mate 90 Series Sales Date: Flagship Timeline Revealed Early Are you tired of waiting…

1 day ago

Huawei Nova 16 Ultra launched with 200MP camera and 7000mAh battery

Huawei has officially launched its highly anticipated Nova 16 smartphone series in China. The absolute…

2 days ago

Huawei Music Latest 2026 Update

Huawei is sending out a brand new software update for its core mobile applications. This…

7 days ago

Huawei Maextro S800 ultra luxury sedan outsells Mercedes Maybach in China

Huawei is quickly changing the luxury car market. In a massive surprise, the technology giant's…

7 days ago

Huawei partners with Keyrus to scale data and AI tools in global markets

Huawei recently announced major global partnership with Keyrus for data and AI growth Huawei is…

7 days ago