https://github.com/allthingstalk/java-sdk
Java SDK for AllThingsTalk IoT Platform
https://github.com/allthingstalk/java-sdk
iot iot-platform java sdk
Last synced: about 1 year ago
JSON representation
Java SDK for AllThingsTalk IoT Platform
- Host: GitHub
- URL: https://github.com/allthingstalk/java-sdk
- Owner: allthingstalk
- Created: 2017-03-15T11:47:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-15T13:53:30.000Z (about 8 years ago)
- Last Synced: 2025-02-06T20:26:11.978Z (over 1 year ago)
- Topics: iot, iot-platform, java, sdk
- Language: Java
- Homepage: https://www.allthingstalk.com
- Size: 1.66 MB
- Stars: 0
- Watchers: 13
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Java SDK [](https://travis-ci.org/allthingstalk/java-sdk)
---
### Installation
Get the `jar` from the Release page and include it in your project.
### Examples
Several basic examples are found in the `/src/examples` folder.
* `Counter.java` send data from your application to AllThingsTalk _(sensing)_
* `Actuation.java` toggle a boolean from AllThingsTalk _(actuation)_
* `BinaryPayload.java` send data of multiple assets together in one binary payload. The corresponding .json file for decoding the payload in AllThingsTalk can be found in the same folder.
### Device Credentials
You can either set them globally, using the same credentials for all applications using the sdk.
Or you can set them locally in a specific sketch, overriding the global settings.
Depending on how you initialize the device object in your application, the global or local credentials will be used.
* `device = new Device(this, "your_device_id", "your_device_token");` will use the provided local credentials
* `device = new Device(this);` will use the global credentials from the keys.json file
### Raspberry Pi support
#### Prerequisites
Java 1.8 installed on your Raspberry Pi.
[Raspian Jessie with Pixel](https://www.raspberrypi.org/downloads/raspbian/) has the latest Java version by default.
> Raspian Jessie lite does not come with Java preinstalled.
#### GPIO pin layout and setup
Please check [the pi4j documentation](http://pi4j.com/example/control.html).
Add the following _jars_ to your project
* `pi4j-core.jar`
* `pi4j-gpio-extension.jar`
You can download the _pi4j_ library [here](http://pi4j.com/download.html).
## Building
You can build the project locally using supplied `gradlew` wrapper:
```bash
gradlew jar
```
This will produce `.jar` in the `build/libs` directory.