Skip to content

literunner/cordova-plugin-alljoyn

 
 

Repository files navigation

cordova-plugin-alljoyn

Android iOS Windows
Circle CI Build Status Build status

A Cordova plugin to expose the AllJoyn Thin Client (AJTCL 14.12) to cross platform applications written in Javascript.

Purpose

To provide a plugin which allows using the AllJoyn Thin Client library across all mobile platforms without requiring the user to deal with implementing and compiling the native code for each operating system.

Current Platforms:

  • iOS
  • Windows Modern App
  • Windows Phone
  • Android (in-progress)

An effort has been made to expose as many of the AJTCL features to Javascript as possible, while maintaining a clean Javascript API. Features are prioritized based on which scenarios they unblock.

Resources

Various explanatory blog posts can be found here: http://www.stefangordon.com/introducing-the-alljoyn-plugin-for-cordova/

For Plugin Developers / Contributors

After cloning this repository, a plugin developer needs to get AJTCL by running these commands in the project root folder:

$ git clone https://github.com/AllJoyn-Cordova/ajtcl.git src/ajtcl

For plugin users, above is taken care of by a hook run after plugin is added with Cordova scripts.

Using The Plugin On Windows

$ cd /path/to/your/cordova/app
$ cordova add [/path/to/plugin or <url to this git repo> or org.allseen.alljoyn]
$ cordova platform add windows

Running With Cordova Scripts:

// To run on Windows Phone 8.1 emulator
$ cordova run windows --emulator --archs="x86" -- -phone
// Running on Windows Phone 8.1 device
$ cordova run windows --device --archs="arm" -- -phone
// To run on desktop (current default is Windows 8.0 build)
$ cordova run windows --device --archs="x64" -- -win

Alternative for running with Cordova scripts is to open the solution file generated after "cordova platform add windows"-command in Visual Studio and running the wanted app project. In this case, these is a need to manually select the correct architecture from build configuration.

Building For Android

In addition to the Android SDK, the NDK is required. See https://developer.android.com/tools/sdk/ndk/index.html for installation instructions.

The environment variables ANDROID_HOME and ANDROID_NDK_HOME must be set to the point to the locations where the Android SDK and NDK are installed.

There are some external dependencies when building the plugin for the Android platform. When building on a Mac, one of the easiest ways to install the dependencies is via Homebrew http://brew.sh/ with following command:

$ brew install ant gradle swig

After dependencies are met, the steps to build and run are something like:

$ cordova platform add android
$ cordova build android
$ cordova run android

Running Tests

The iOS tests can be run locally with:

$ npm install
$ npm test

With above commands, the tests are run on real device if Cordova scripts find one or in simulator if device not found

To run tests on Windows, first ensure that fresh enough Cordova script is found from the path. You can look at appveyor.yml file from the root of this repository how this is done in the CI environment. You can use where command to check which cordova is found first from your path:

$ where cordova

Then, in the root of the repository:

$ npm install
$ set PATH=%cd%\node_modules\.bin;%PATH%
$ cordova-paramedic --platform windows --plugin %cd% --tempProjectPath %tmp%\testApp --architecture=x86 --phone=true

Above runs the tests on a Windows Phone emulator. To run on real device, make sure it is connected and run:

$ cordova-paramedic --platform windows --plugin %cd% --tempProjectPath %tmp%\testApp --architecture=arm --phone=true --device=true

About

Native Cross-Platform AllJoyn Thin Client Plugin For Cordova

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 46.6%
  • Objective-C 19.6%
  • C++ 18.6%
  • JavaScript 13.6%
  • Java 1.6%