Developing Applications with the Things SDK API

 

To create a new application project using the Things SDK API:

  1. In the Tizen Studio, select File > New > Tizen Project.
  2. Select Sample, and click Next.

    Tizen Project Wizard

  3. Select Custom > Iot-headless v4.0, and click Next.

    Tizen Project Wizard

  4. Select Native Application, click Next, select the Network Audio sample app, and click Finish.

    Select a native project

  5. Edit the source code. The code is composed of a device definition JSON file (in the res/ directory) and code implementation C files.

    For more information, see the Things SDK API. For more information on the JSON file, see Device Definition, and for C APIs and callbacks, see API Usage.

    Note The Network Audio sample application can be built without any modification. To run it, connect the audio jack of the board to a speaker.

    Instead of using an existing sample as a basis for your application, you can use the IoT template that makes use of the Things SDK API:

    1. In the Tizen Studio, select File > New > Tizen Project.
    2. Select Template, click Next, select Custom > Iot-headless v4.0, and click Next.
    3. Select Native Application, click Next, select the IoT template, and click Finish.
  6. You need a certificate to make the device work correctly. You only have to create the certificate once, when you first install the Tizen Studio.
    1. In the Tizen Studio menu, open the Certificate Manager by going to Tools > Certificate Manager.

      Open the Certificate Manager

    2. To create a new certificate, click + and Next.

      Create a new certificate

    3. Enter the certificate profile name and click Next.

      Enter certificate name

    4. In the Author Certificate tab, select Create a new author certificate and click Next.

      Create authot certificate

    5. Enter the author information in the Key Filename, Author Name, and Password fields, and click Next.

      Enter author details

    6. In the Distributor Certificate tab, select Use the default Tizen distributor certificate and select Platform in the Privilege level drop-down menu.

      Create distributor certificate

      Note The default privilege level is Public, but you can change it to Platform for development purposes.
    7. You can review the information of the certificates you have created in the Certificate Manager window.

      View certificate details

  7. To connect to the SmartThings Cloud, you must have a cloud certificate.

    For more information, see Setting up the SmartThings Cloud.

  8. Connect the ARTIK 530 or Raspberry Pi 3 board to a Linux computer with a USB cable.

    For more information, see Flashing Tizen Images.

    Note You need to confirm that "artik" or "rpi3" is shown in the top center box in the Tizen Studio.

    View certificate details

    View certificate details

  9. In the Tizen Studio Project Explorer view, right-click the project and select Run As > Tizen Native Project.

    Running the project