API Overview

The Evothings Viewer app ships with selected Cordova plugins, which are listed below.

Evothings also provides a number of JavaScript libraries for IoT, built on top of the Cordova plugins.

Below you find API documentation for plugins and libraries.

Cordova plugins

Evothings Viewer comes pre-packaged with the following Cordova Plugins.

Note that the JavaScript source files for the plugins are packaged into Evothings Viewer. You don't need to explicitly include these files in your HTML code, they are included automatically with cordova.js.

Bluetooth

Evothings Bluetooth Low Energy (BLE) Plugin [API Reference] [Tutorial] [GitHub]

Bluetooth Serial Plugin (available in Evothings Viewer for Android only)

Eddystone and iBeacon

Evothings Eddystone Library (written on top of the BLE plugin) [API Reference] Library file: [eddystone.dist.js]

Cordova iBeacon Plugin

QR-code and Barcode Scanner

Barcode scanner plugin

Background notifications

Cordova local notification plugin

Network plugins (WiFi connectivity)

cordova-HTTP
chrome.system.network
chrome.sockets.tcp
chrome.sockets.tcpServer
chrome.sockets.udp

Standard Cordova plugins

Battery Status
Camera
Console
Device
Device Motion (Accelerometer)
Device Orientation (Compass)
Dialogs
Geolocation
Globalization
InAppBrowser
Network Information (Connection)
Statusbar
Vibration
Legacy Whitelist

Evothings JavaScript libraries

Evothings JavaScript libraries provide essential functionality for IoT enabled mobile apps:

  • evothings.ble - API for accessing BLE devices. This API is included with Evothings Viewer and the Cordova BLE plugin. Just include cordova.js in your index.html file and you will have the API available.
  • BLE API Guide: How to connect to BLE devices - This guide shows how to use the Evothings BLE API and how to connect to custom BLE devices.
  • evothings.eddystone - Library for scanning for Eddystone devices. This library is written on top of the BLE plugin. Get this library on GitHub: eddystone.dist.js
  • evothings - Functions for asynchronous loading of JavaScript files and platform checking functions. Async file loading is used by some libraries, notable the TI SensorTag library and the Dialog IoT Sensor Library.
  • evothings.util - Functions for parsing numbers encoded as binary data.
  • evothings.tisensortag High-level library for the TI Bluetooth Smart SensorTag.
  • evothings.iotsensor High-level library for the Dialog IoT Sensor.

Since Cordova loads plugins asynchronously, you should always wait for the Cordova 'deviceready' event before calling any plugin APIs or library functions. Here is an example:

function main()
{
    // Cordova plugins are loaded, plugin APIs are ready to be used.
}

document.addEventListener(
    'deviceready',
    main,
    false)

Browse the JSDoc generated API documentation for the Evothings JavaScript libraries to learn more.

The source code for the libraries is included with each example app that is available in Evothings Studio, and is also found on GitHub: https://github.com/evothings/evothings-libraries