Client Library Best Practices

Make sure that your application using the Oracle Internet of Things Cloud Service client library APIs performs a well-defined set of tasks for using the Client Library APIs.

Note:

When publishing an application, a new provisioning file must be created for the application. You can't use the same provisioning file for multiple applications.

Before you write the application, you need to make certain decisions or obtain certain information so that your application performs the necessary tasks:
  • Determine the resources you will use to exchange data between your device and the server

  • Determine the message formats you will use

  • Determine how to communicate securely between the server and the client (using the device ID and other properties)

Once you assemble this information, you can write an application that performs the following tasks:
  • Instantiates the application class

  • Retrieves any properties needed by the application

  • Initializes a device client

  • Obtains or creates a private key for secure communication with the server

  • Registers request handlers for all resources that will be used

  • Retrieves resource values from the device and sends messages to the server about them, or sets them as needed

  • Tracks message delivery

  • At the end, releases resources by unregistering the request handlers and closing the device client.