提交 03821a65 编写于 作者: E ester.zhou
上级 a9470625
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- [Full SDK Compilation](full-sdk-compile-guide.md) - [Full SDK Compilation](full-sdk-compile-guide.md)
- [Switching to Full SDK](full-sdk-switch-guide.md) - [Switching to Full SDK](full-sdk-switch-guide.md)
- [Using Native APIs (NDK) of the OpenHarmony SDK in a CMake Project](cmake-with-ndk.md) - [Using NDK in a CMake Project](cmake-with-ndk.md)
- [Application Model Development](faqs-ability.md) - [Application Model Development](faqs-ability.md)
- ArkUI Development (ArkTS) - ArkUI Development (ArkTS)
- [ArkTS Syntax Usage](faqs-arkui-arkts.md) - [ArkTS Syntax Usage](faqs-arkui-arkts.md)
......
# Using Native APIs (NDK) of the OpenHarmony SDK in a CMake Project # Using NDK in a CMake Project
## What Is Native API ## What Is Native API
...@@ -10,34 +10,34 @@ You download the Native API Development Kit (NDK) by downloading the OHOS SDK, w ...@@ -10,34 +10,34 @@ You download the Native API Development Kit (NDK) by downloading the OHOS SDK, w
- (Recommended) Acquire source code from mirrors for an officially released version. For details, see [release notes](../../release-notes/OpenHarmony-v3.2-release.md). - (Recommended) Acquire source code from mirrors for an officially released version. For details, see [release notes](../../release-notes/OpenHarmony-v3.2-release.md).
- Download the SDK from the SDK Manager in DevEco Studio. - Download the SDK from the SDK Manager in DevEco Studio.
- Download the SDK from the [daily build](http://ci.openharmony.cn/dailys/dailybuilds), by clicking the download link to the **ohos-sdk-full** component. - Download the SDK from the [daily build](http://ci.openharmony.cn/workbench/cicd/dailybuild/dailylist), by clicking the download link to the **ohos-sdk-full** component.
![Download from Daily Build](figures/ci_download.png) ![](figures/ci_download.png)
## Decompressing the NDK ## Decompressing the NDK
Place the downloaded NDK in a folder you prefer and decompress it. Below shows the directory structure after decompression. Place the downloaded NDK in a folder you prefer and decompress it. Below shows the directory structure after decompression.
![SDK Directory Structure](figures/sdk-structure.png) ![](figures/sdk-structure.png)
Configure the Linux environment as follows: (Skip them if the NDK is downloaded from DevEco Studio.) Configure the Linux environment as follows: (Skip them if the NDK is downloaded from DevEco Studio.)
1. Add the CMake tool that comes with the NDK to the environment variables. Add the CMake tool that comes with the NDK to the environment variables.
``` ```
# Open the .bashrc file. # Open the .bashrc file.
vim ~/.bashrc vim ~/.bashrc
# Append the custom CMake path to the file. Save the file and exit. # Append the custom CMake path to the file.
export PATH=~/ohos-sdk/ohos-sdk/linux/native/build-tools/cmake/bin:$PATH export PATH=~/ohos-sdk/ohos-sdk/linux/native/build-tools/cmake/bin:$PATH
# Run the source ~/.bashrc command to make the environment variables take effect. # Run the source ~/.bashrc command to make the environment variables take effect.
source ~/.bashrc source ~/.bashrc
``` ```
2. Check the default CMake path. Check the default CMake path.
``` ```
# Run the which cmake command. # Run the which cmake command.
which cmake which cmake
# The result should be the same as the custom path previously appended to the file. # The result should be the same as the custom path previously appended to the .bashrc file.
~/ohos-sdk/ohos-sdk/linux/native/build-tools/cmake/bin/cmake ~/ohos-sdk/ohos-sdk/linux/native/build-tools/cmake/bin/cmake
``` ```
......
...@@ -42,7 +42,7 @@ Creates a **FormComponent** instance to display the provided widget. ...@@ -42,7 +42,7 @@ Creates a **FormComponent** instance to display the provided widget.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | ------------------------------- | ---- | ----------------------------------------------------------------------- | | --------- | ------------------------------- | ---- | ----------------------------------------------------------------------- |
| id | number | Yes | Widget ID. Set this parameter to **0** for a new widget. | | id | number | Yes | Widget ID. Set this parameter to **0** for a new widget.<br>**NOTE**<br>Different widget hosts cannot use the same ID.<br>If a widget host uses the same ID for two widgets, the one added later is displayed. |
| name | string | Yes | Widget name. | | name | string | Yes | Widget name. |
| bundle | string | Yes | Bundle name of the widget. | | bundle | string | Yes | Bundle name of the widget. |
| ability | string | Yes | Ability name of the widget. | | ability | string | Yes | Ability name of the widget. |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册