This topic describes the Java SDK demos used on your servers and on the devices. You must prepare a Java development environment, download the SDK demo package, import a project, and then initialize the SDKs.


  1. Click iot api demo to download iotx-api-demo, and decompress the package.
    This package contains the server SDK demo and the device SDK demo.
  2. Open the Java development tool and import the decompressed folder iotx-api-demo.
  3. In the java directory, add the following dependencies to the pom file to import the server SDK and device SDK.
    <! -- -->
  4. In the directory java/src/main/resources/, configure the initialization in the config file.
    user.accessKeyID = <your accessKey ID>
    user.accessKeySecret = <your accessKey Secret>
    iot.regionId = <regionId>
    iot.productCode = Iot
    iot.domain = iot.<regionId>
    iot.version = 2018-01-20
    Parameter Description
    accessKeyID The AccessKey ID of your Alibaba Cloud account.

    Place the pointer on your profile icon in the console, select AccessKey to go to the User Management page. You can create or check your AccessKey in User Management.

    accessKeySecret The AccessKey Secret of your Alibaba Cloud account. You can check the AccessKey Secret in the same way as the AccessKey ID.
    regionId The ID of the region where your IoT devices are located. For more information about region ID expressions, see Regions and zones.

What to do next

Connect the gateway to IoT Platform

Connect the sub-device to IoT Platform