  Introduction
  ------------
  This is a sample Java application designed to showcase the functionality of 
  the Binary Data Points feature. The main advantage of using this 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 is launched, it instantiates a new Cloud Connector for 
  Java. After that, Cloud Connector is started.

  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.


  Main files
  ----------
    * com.etherios.connector.binarydatapoints.MainApp.java:
      Main application class. Instantiates and starts the Cloud Connector object.

    * com.etherios.connector.binarydatapoints.ConnectorEventsListener.java:
      Class that handles the connector events.

    * com.etherios.connector.binarydatapoints.PatientMonitor.java: 
      Class that sends the vital signs of a patient to Device Cloud inside 
      binary data points.

    * connector_config.txt:
      Cloud Connector general settings.


  Requirements
  ------------
  To run this example you will need:
    * A PC connected to the Internet to host and run the application.
    * A Device Cloud account.
      For further information on how to create a Device Cloud account go to
      the 'Creating a Device Cloud Account' topic of the Getting Started.


  Example setup
  -------------
    1) Ensure Cloud Connector is properly configured.
       This can be done editing the 'connector_config.txt' file which is 
       located in the 'res' folder of the project. Make sure that the 
       'vendor_id' field is filled with your account Vendor ID.
       
       For further information on how to configure the 'connector_config.txt'
       file, go to the 'Cloud Connector Configuration' topic of the
       Developer's Guide.

    2) Ensure the device is registered in your Device Cloud account.
       By default, it is registered automatically because the Device ID is 
       provisioned from Device Cloud. If you want to modify this behavior, 
       read the 'Device ID Type' section (Developer's Guide > Cloud Connector 
       Configuration > General Settings).

    3) The Application Descriptor needs the following API Permissions:

        java.util.PropertyPermission "*" "read,write"
        javax.microedition.io.AccessPointPermission "*"
        javax.microedition.io.Connector.file.read
        javax.microedition.io.Connector.file.write
        javax.microedition.io.SocketProtocolPermission "socket://:*"
        javax.microedition.io.SocketProtocolPermission "socket://*:*"
        javax.microedition.io.SSLProtocolPermission "ssl://:*"
        javax.microedition.io.SSLProtocolPermission "ssl://*:*"
        javax.microedition.location.LocationPermission "location" "location"

    4) The Etherios public certificate is imported to the device's keystore.
       For further information, read the 'Adding the Etherios Certificate to
       Your Device' topic inside 'Creating and Building a Java Project with 
       Cloud Connector support' of the Developer's Guide.


  Running the example
  -------------------
  The example is already configured, so all you need to do is to build and 
  launch the application. Refer to the general instructions about how to build, 
  run, and debug the examples for further information.

  To verify that the application is running successfully, follow these steps:

     1) Login into your Device Cloud account.

     2) Click on the 'Device Management' tab.

     3) Verify that your device is connected (you can also check it from the
        output of the logger).

     4) Click on the 'Data Services' tab and go to 'Data Streams'.

  When you launch the application, you will see a new data stream that contains
  several binary data points.

  To obtain the data from a binary data point you have to use the Device Cloud
  Web Services. To do so, go to the 'API Explorer' inside the 'Documentation'
  tab and do a GET request with the following path:

  /ws/DataPoint/XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX/patient

  where XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX is the Device ID of your device.
  The response will appear on the 'Web Services Responses' pane. You will find
  the data clicking on it.

  The data appears in base64 format, and is encrypted with the AES algorithm 
  using the 128 bits key 'thisIsASecretKey'. You can decrypt it using any
  online AES decryption tool.
