Samples & Demos

The sections below describes each of the samples included with the Cloud Connector SDK. These samples are meant to demonstrate the different features of Cloud Connector for Java.

All of the sample & demos projects are contained in the samples/java_apps folder of the Cloud Connector SDK.

The available samples and demos are:

Data Points Sample

This sample showcases the functionality of the Device Cloud Data Streams and Data Points feature and shows you how new data points can be uploaded to Device Cloud using the Cloud Connector. Data streams represent time series data as a sequence of data points.

When the application launches, it instantiates a new Cloud Connector for Java. After that, Cloud Connector starts. Once the connection is established, the application pushes to Device Cloud the amount of free and used memory in the JVM every 30 seconds.

The sample project is located within the samples/java_apps directory and is named DataPointsSampleME.

Make sure you carefully read the Readme.txt file located in the root folder of the project before building and launching the sample.

Binary Data Points Sample

This sample showcases the functionality of the Binary Data Points feature. The main advantage of using these kind of Data Points is that they are concise and minimize the data traffic, since only the binary value is sent to Device Cloud.

When the application launches, it instantiates a new Cloud Connector for Java. After that, Cloud Connector starts.

This example simulates an application that monitors the vital signs of a patient and sends them to Device Cloud. Since they are sensitive and confidential data, the application sends them as encrypted binary data using binary data points.

The sample project is located within the samples/java_apps directory and is named BinaryDataPointsSampleME.

Make sure you carefully read the Readme.txt file located in the root folder of the project before building and launching the sample.

Data Push Sample

This sample showcases the functionality of the Data Storage Service. This feature provides a temporary repository for storing files for later retrieval by either the device or web services application. The most common usage is for devices to post data to the data store so that a web services client application may check periodically to retrieve any new or updated contents.

This example simulates a security camera. Once the connection is established, the application pushes a short video every 10 seconds to Device Cloud until all the clips inside the 'videos' folder have been uploaded.

The sample project is located within the samples/java_apps directory and is named DataPushSampleME.

Make sure you carefully read the Readme.txt file located in the root folder of the project before building and launching the sample.

Device Request Sample

This sample showcases the functionality of the Device Request feature and demonstrates how Device Cloud can be used to control remote devices.

Once the connection is established, the sample waits for incoming requests to process them. If the target is 'screenshot', a capture of your Desktop is uploaded to the specified directory in Device Cloud.

The sample project is located within the samples/java_apps directory and is named DeviceRequestSampleME.

Make sure you carefully read the Readme.txt file located in the root folder of the project before building and launching the sample.

File System Sample

This sample showcases the functionality of the File System Service. This feature allows you to list, download, upload and remove files, remotely on the device file system.

Once the connection is established, the application waits for upload file events. When this kind of events occurs, the file is processed by the device, and the contents are printed line by line only if it is included in the application's library list.

The sample project is located within the samples/java_apps directory and is named FileSystemSampleME.

Make sure you carefully read the Readme.txt file located in the root folder of the project before building and launching the sample.

RCI Sample

This sample is designed to showcase the functionality of the Remote Command Interface (RCI) service and demonstrates how Device Cloud is used to control remote devices. RCI allows Device Cloud to offer a configuration layer via Device Management accessing device settings and status information described within a descriptor file.

When the application launches, it instantiates a new Cloud Connector for Java with a custom RCI extension. After that, Cloud Connector is started.

This example simulates an application that is able to control and configure some network settings (such as IP Address, DNS server or WiFi/Cellular connection). Because this is not possible in most computers, these settings are read and written in a properties file (settings.txt), in the root of the project.

The sample project is located within the samples/java_apps directory and is named RCISampleME.

Make sure you carefully read the Readme.txt file located in the root folder of the project before building and launching the sample.

Firmware Update Sample

This sample showcases the functionality of the Firmware Update Service. From time to time, new firmware may need to be programmed on some of your remote devices. The Remote Firmware Update feature allows you to update the firmware (single or multiple partitions or targets), through Device Cloud on those devices that support the feature.

When the application launches, it instantiates a new Cloud Connector for Java. After that, Cloud Connector starts. Once the connection is established, the application waits until a firmware update request is received and simulates the update process.

The sample project is located within the samples/java_apps directory and is named FirmwareUpdateSampleME.

Make sure you carefully read the Readme.txt file located in the root folder of the project before building and launching the sample.

Simulated Tank Demo

This demo simulates a tank: its level, temperature and the status of the In/Out valves.

Every 2 seconds the sample updates the status of the simulated tank parameters. This includes the randomly generated temperature and the level calculated based on the status of the valves. Every 10 seconds the status of these variables is checked and new samples are pushed to Device Cloud.

When the application launches it will automatically connect to Device Cloud. Once a connection is established, the application starts the tank monitoring and the new values are pushed to Device Cloud:

This sample also waits for incoming data requests to open/close the tank's valves.

Before running the example, please read through the information below and configure all necessary items.

  1. Device Cloud by Etherios. Device Cloud easily connects your device running Cloud Connector (Step 2) and the WEB application (Step 3) even when firewalls are in use.

    To learn more about Device Cloud visit following the web page: www.etherios.com/devicecloud

  2. Cloud Connector by Etherios. Software which allows you to easily integrate any M2M device with Device Cloud.

  3. WEB application. A WEB application using Google App Engine has been developed to remotely monitor and control your device. It can be executed directly from the App Engine, where it is hosted, on any PC with an Internet connection.

    You can learn more about Google App Engine here: http://developers.google.com/appengine/

    Our app can be found here: http://device-cloud-tank-demo.appspot.com

Using these pieces the Simulated Tank example demonstrates the following:

The sample project is located within the samples/java_apps directory and is named TankDemoME.

Make sure you carefully read the Readme.txt file located in the root folder of the project before building and launching the sample.