简体中文 | English
This demo shows the basic features and use cases of the IoT Hub SDK for Android through four tab pages.
├── Demo
│ ├── Basic feature
│ ├── Device interconnection
│ ├── Device shadow
│ ├── Remote service
This page contains three sections from top to bottom: parameter settings section, feature operation section, and log output section.
-
Parameter settings section
- It provides the input box for the drop-down options
key
andvalue
(which are optional here). You can set them in app-config.json.
- It provides the input box for the drop-down options
-
Feature operation section
- It offers the following operations: connection to/disconnection from MQTT, dynamic registration, topic-related operations (subscribing to/unsubscribing from/publishing to topic and subscribing to RRPC/broadcast topics), subdevice connection/disconnection, check for firmware update, log-related operations, subdevice binding/unbinding, device topological relationship query, and WebSocket-related operations.
- Note: to use other features in the feature operation section, you must click Connect to MQTT and wait until the log output section print out
onConnectComplete, status[ok]
.
-
Log output section
- Logs of operations performed in the feature operation section will be output in this section; for example, if you click Subscribe to Topic,
onSubscribeCompleted
will be printed out here.
- Logs of operations performed in the feature operation section will be output in this section; for example, if you click Subscribe to Topic,
This page contains two sections from top to bottom: feature operation section and log output section.
-
Feature operation section
- Smart home scenario background
- It offers two operations: homecoming and homeleaving. The former turns on the air conditioner in the room, while the latter turns off the air conditioner.
-
Log output section
- Logs of operations performed in the feature operation section will be output in this section; for example, if you click Come Home,
receive command: open airconditioner
will be printed out here.
- Logs of operations performed in the feature operation section will be output in this section; for example, if you click Come Home,
This page contains two sections from top to bottom: feature operation section and log output section.
-
Feature operation section
- It offers the following operations: connection to/disconnection from IoT Hub, device attribute registration, device document acquisition, regular device shadow update, and topic-related operations (subscribing to/unsubscribing from/publishing to topic).
-
Log output section
- Logs of operations performed in the feature operation section will be output in this section; for example, if you click Get Device Document,
document[{...
will be printed out here.
- Logs of operations performed in the feature operation section will be output in this section; for example, if you click Get Device Document,
This page contains two sections from top to bottom: feature operation section and log output section.
-
Feature operation section
- It offers the following operations: remote service start/stop and shadow enablement/disablement, where remote service refers to running features in the Android Service component such as disconnecting from MQTT.
- If you select the Use Shadow option, operations such as device attribute registration, device shadow acquisition, and device shadow update will be available.
-
Log output section
- Logs of operations performed in the feature operation section will be output in this section; for example, if you click Start Remote Service,
remote service has been started!
will be printed out here.
- Logs of operations performed in the feature operation section will be output in this section; for example, if you click Start Remote Service,