Connect any android device to UnificationEngine using IoTool

Overview

Skill Level: Intermediate Basic knowledge of Android development is recommended.


Step by step guide of how to connect your IoTool app to UnificationEngine. We will use this connection to publish events recorded by IoTool to UnificationEngine Platform.

Ingredients

  1. UnificationEngine

  2. Android device (API 18) with the latest IoTool app with sensor reading extension.

Step-by-step

  1. Setting up your UnificationEngine extension Before we can start, we need to set up an extension. To do that, we need to add a new application and new connectors. Log in to your UnificationEngine account. Find a button "My apps" located in the top right corner of the screen and click it. It should give you a list of your currently existing apps. A button that allows you to add a new app is located on the left side of the screen. Click it and give your new app a name. After that, we need to add a connector. On the left side of your screen choose your newly created app. Find a button "Add Connector". The button is located below the bottom of the list of current connectors. Choose where are you going to send your data. The API key and API secret of connectors should be provided by the third party if needed (Facebook, Tumblr, Twitter, etc.). Note that the API key and API secret can also go by a different name (example: customer key, customer secret).

    MyApp
    AddApp
    AddConnector
  2. Choosing the cloud extension in IoTool

    Here we will talk about how to select a cloud extension for IoTool. To choose which extension you want to use, you have to open the menu drawer, by clicking on the icon IoToolMenu, located in the top left of the screen. After that, navigate through "Settings" → "Cloud" → "Select cloud service" and select "UnificationEngine service". Make sure that synchronization settings are set up like in the picture bellow.

    initialScreen
    IoToolOpenMenu
    sync
    sync2
  3. Setting up your IoTool application

    Now we need to go to settings of your application and set up parameters for its connection. You will need to know the following parameters:

    • App key

    • App secret key

    • Connector identifier (Where are you sending data)

    • Access token

    • Secret token

    • *Hostname (Third party hostname)

    • *Receiver (profile id, e-mail address or phone number)

    • Sender (profile id, e-mail address or phone number)

    • Parameters (additional parameters to send)

      To get the API and secret keys, click on "My apps" and then click on the chosen application. The information about the API should appear in the middle of the screen. Copy the app and secret keys into your settings. The access token is a series of random symbols. It can be only obtained after logging into the third party account. Some companies provide easy access to that token, usually by going to developer account of said third party. Connector identifier determines where the data is going to be sent. Choose where you want to send it. Receiver and sender parameters determine to or from who the data is transferred. It is used to send an e-mail or SMS to a user of your choice. If you do not intend to use this, just put a random series of symbols. Parameters are used to send additional settings to the cloud. They are important because they provide additional information for a specific connector, so it can work correctly. Each connector has its own set of additional parameters, but mostly they are not needed. These parameters need to be in correct order and separated by commas.

      Keys

      We continue we need to address the fact that specific connectors have different sets of rules about what needs to be empty and what needs to be filled in. Therefore a table with correct settings for each of the available connectors is provided below.

      Connector Token Secret Params

      Facebook

      yes

      no

      no

      Fbmessenger

      yes

      no

      no

      Googleplus

      yes

      no

      id, refresh_token, and is_profile (is_profile is always false)

      Instagram

      yes

      no

      username and password

      Kakaostory

      yes

      no

      refresh_token

      Line

      yes

      no

      no

      Linkedin

      yes

      no

      id and is_profile (if is_profile contains user ID then it’s true, otherwise false)

      Pinterest

      yes

      no

      id, is_profile, and username (is_profile is always true)

      Sendgrid

      yes

      no

      no

      Skype

      yes

      no

      id (id = BOT_ID)

      SMS

      yes

      yes

      phone_number is a phone number with country code

      Smtp

      no (EMAIL_ID:PASSWORD@HOST:PORT)

      no

      no

      Telegram

      yes

      no

      no

      Tumblr

      yes

      yes

      no

      Twitter

      yes

      yes

      no

      Viber

      yes (SERVICE_ID)

      no

      phone_number is a phone number with country code

      Weibo

      yes

      no

      id and is_profile (is_profile is always true)

      Whatsapp

      yes (PHONE_NUMBER_WITH_COUNTRY_CODE)

      no

      no

      Xing

      yes

      yes

      no

    To open the settings for UnificationEngine tap on the "UnificationEngine Service Settings".

    + image::sync2.png[width=200]

Examples:

Tumblr:

  • App key: "<appkey>"

  • App secret key: "<secretkey>"

  • Connector identifier: "Tumblr"

  • Access token: "<tumblrAccessToken>"

  • Secret token: "<tumblrSecretToken>"

  • Hostname: "tumblr.com"

  • Receiver: "frenk99999"

  • Sender: "frenk99999"

  • Parameters: ""

Google+:

  • App key: "<appkey>"

  • App secret key: "<secretkey>"

  • Connector identifier: "Google +"

  • Access token: "<googleAccessToken>"

  • Secret token: ""

  • Hostname: "plus.google.com"

  • Receiver: "111838128181974458225"

  • Sender: "111838128181974458225"

  • Parameters: "111838128181974458225,<tokenRefresh>,false"

Twitter:

  • App key: "<appkey>"

  • App secret key: "<secretkey>"

  • Connector identifier: "Twitter"

  • Access token: "<twitterAccessToken>"

  • Secret token: "<twitterSecretToken>"

  • Hostname: "twitter.com"

  • Receiver: "franksenlab"

  • Sender: "frenksenlab"

  • Parameters: ""

Note that text denoted in <> represents information that should not be public. You will have to replace them with actual values.