1 Star 0 Fork 246

张前福 / knowledge_demo_smart_home

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README_zh.md 3.47 KB
一键复制 编辑 原始数据 按行查看 历史

Contacts应用开发样例

样例简介

Contacts应用是基于OpenHarmony SDK开发的安装在润和HiSpark Taurus AI Camera(Hi3516d)开发板标准系统上的应用;应用主要功能是展示联系人列表,并点击某一列弹出联系人详细信息;

运行效果

样例效果

样例原理

样例主要有一个list组件和dialog组件组成,初始化加载数据展示列表,点击某一列弹出对话框信息;如下图:

原理图

工程版本

  • 系统版本/API版本:OpenHarmony SDK API 8
  • IDE版本:DevEco Studio 3.0 Beta3

快速上手

准备硬件环境

搭建标准系统环境

准备开发环境

准备工程

配置git
  • 提前注册准备码云gitee账号。

  • git工具下载安装

    sudo apt install git
    sudo apt install git-lfs
  • 配置git用户信息

    git config --global user.name "yourname"
    git config --global user.email "your-email-address"
    git config --global credential.helper store
git下载
git clone https://gitee.com/openharmony-sig/knowledge_demo_smart_home.git --depth=1
工程导入
  • DevEco Studio导入本工程;

    打开DevEco Studio,点击File->Open->下载路径/FA/Contacts

    打开工程导入工程

编译

  • 点击File > Project Structure > Project > Signing Configs界面勾选“Automatically generate signing”,等待自动签名完成即可,点击“OK”。如下图所示:运行

  • 点击Build->Build Hap/APPs 编译,编译成功生成entry-debug-rich-signed.hap

编译编译完成

烧录/安装

  • 将搭载OpenHarmony标准系统的开发板与电脑连接。
  • 识别到设备后点击img,或使用默认快捷键Shift+F10(macOS为Control+R)运行应用。

运行

  • 安装应用 如果IDE没有识别到设备就需要通过命令安装,如下

    打开OpenHarmony SDK路径 \toolchains 文件夹下,执行如下hdc_std命令,其中path为hap包所在绝对路径。

    hdc_std install -r path\entry-debug-standard-ark-signed.hap

    PS环境准备,源码下载,编译,烧录设备,应用部署的完整步骤请参考这里

操作体验

操作体验

参考资料

1
https://gitee.com/Cruise2021/knowledge_demo_smart_home.git
git@gitee.com:Cruise2021/knowledge_demo_smart_home.git
Cruise2021
knowledge_demo_smart_home
knowledge_demo_smart_home
master

搜索帮助