Eisforinnovate / cordova-androidwear

Android Wear Cordova Plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cordova Android Wear Plugin

The plugin has functions that allows your app to have bidirectional communication with Android Wear Smartwatch applications and Cordova applications.

Installation

cordova plugin add net.trentgardner.cordova.androidwear

Usage

  1. Add the plugin to your cordova project.

  2. Bundle your watch apk in your project by following the instructions in the documentation.

Example

AndroidWear.onConnect(function(e) {
    alert("Connection Successfully Established - handle: " + e.handle);

    AndroidWear.onDataReceived(e.handle, function(e) {
        alert("Data received - handle: " + e.handle + " data: "+ e.data);
    });

    AndroidWear.sendData(e.handle, "Hello From Cordova!");
});

A slightly more complete example is available at https://github.com/tgardner/cordova-androidwear-example

About

Android Wear Cordova Plugin

License:Apache License 2.0


Languages

Language:Java 97.2%Language:JavaScript 2.8%