接入指南

Android SDK接入指南

1.开发环境

由于最终集成SDK的软件需要安装至智能主机上 因此开发方式为原生App开发因此需要具有Android开发环境,推荐使用Android Studio开发工具 请开发者优先配置好Android的开发环境后进行开发

2.对接Demo下载

使用 Android Studio 导入此Demo编译运行到智能主机上即可实现通信

3.智能主机如何导入设备

1.选择添加方式为 智能家居服务发现

2.登录智能家居平台

3.登录成功后进入设备添加界面

选中设备后点击确认添加即可将设备导入到智能主机中进行控制

4.获取智能家居开发包

链接: https://pan.baidu.com/s/1X_2uclN3VDJ7BW2V10t9wA 提取码: 6aaz

5.项目配置

5.1在AndroidStudio Module级别下配置build.gradle

repositories {
    flatDir {
        dirs 'libs'
    }
}
dependencies {
    implementation name: 'yz_iot_v0.1',ext:"aar"
    implementation 'com.github.zhaokaiqiang.klog:library:1.6.0'
    implementation 'com.alibaba:fastjson:1.1.71.android'
}

5.2创建类并继承自YzIotService实现父类方法并配置AndroidManifest.xml

public class CustomService extends YzIotService {
    ..........
}

配置AndroidManifest.xml并注册该服务类

<service android:name=".CustomService">
    <intent-filter>
        <action android:name="com.youzhuan.iotserver"/>
    </intent-filter>
</service>

最后更新于