News from September 7 Yesterday, Huawei officially stated that HarmonyOS was new to the Sample this week and 5 new examples were added, including the JsFACard example function, the JsRouter example, the NativeImage example, the JsTimer example, and the JsDevice example.
Huawei Hongmeng HarmonyOS 2 adds 5 new Sample examples
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.
Sample2: 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.
Sample3: 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.
Sample4: 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.
Sample5: New JsDevice sample
Scenario: This example uses the deviceInfo, systemParameter and batteryInfo interfaces to query device information, system properties, and battery and charging properties respectively.
Developers can directly import examples through DevEco Studio, the steps are as follows:
- Click File>New>Import HarmonyOS Sample under DevEco Studio, and a Sample selection box will pop up.
- Select Sample and click "Next", then the storage path selection box will pop up, click "Finish" after setting, and wait for the sample to be downloaded.