# NAPI_Learning **Repository Path**: hu-min2021/NAPI_Learning ## Basic Information - **Project Name**: NAPI_Learning - **Description**: NAPI使用循序渐进,学习。查看提交记录 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 5 - **Created**: 2023-01-19 - **Last Updated**: 2023-01-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # NAPI-Learning ## 1.介绍 本示例主要介绍NAPI在鸿蒙中的使用 ### 1.1 entry Module #### 1.1.1 同步操作 add(3+2) sub(3-2) hyPotC(3,2) 3和2平方和取根 addsync(10+2) #### 1.1.2 异步操作 addAsyncByPromise(3+2) getAsyncByCallback(3+2) #### 1.1.3 类绑定调用 创建对象 执行方法 #### 1.1.4 Interface接口调用 参考 getNativeInterface ### 1.2 NativeSample 演示三方库加载相关内容 #### 1.2.1 native侧加载 cmake依赖 dlopen加载 so库编译详见文件private_custom/compileSo/README.md #### 1.2.2 ets应用侧加载 实际为1.2.1中“camke依赖”的精简版,利用camke生成的库 1)将库预制到libs/arm64-v8a 和 libs/armeabi-v7a目录下 2)直接将src/main/cpp目录下的cpp相关文件删除,包括index.etx也可以选择删除 编译应用直接运行即可 ## 2.软件架构 软件架构说明 ## 3.安装教程 1. xxxx 2. xxxx 3. xxxx ## 4.使用说明 1. xxxx 2. xxxx 3. xxxx ## 5.参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request ## 6.特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)