Using AllJoyn with Apache Cordova, Python & Node



Similar documents
Present and Act Upon. Register. Consume. Stream Analytics. Event Hubs. Field Gateway. Applications Cloud Gateway. Legacy IoT (custom protocols)

Programming the Internet of Things

Getting Started Android + Linux. February 27 th, 2014

A little code goes a long way Cross-platform game development with Lua. Ivan Beliy, Software Engineer

Extending Tizen Native Framework with Node.js

Getting Started with the AllJoyn Lighting Service Framework 14.12

AllJoyn Framework System Overview

A Way Out of the Mobile App Development Conundrum

Bridging the Gap: from a Web App to a Mobile Device App

Enabling Cordova (aka PhoneGap) on Tizen. René Pourtier / Luc Yriarte

Developing and deploying mobile apps

Secure Cloud and Remote Service Connections for AllJoyn Applications

HybriDroid: Analysis Framework for Android Hybrid Applications

Secure Cloud and Remote Service Connections for AllJoyn Applications

Programming models for heterogeneous computing. Manuel Ujaldón Nvidia CUDA Fellow and A/Prof. Computer Architecture Department University of Malaga

The Decaffeinated Robot

Develop a Native App (ios and Android) for a Drupal Website without Learning Objective-C or Java. Drupaldelphia 2014 By Joe Roberts

Secure Cloud and Remote Service Connections for AllJoyn Applications

Creating Enterprise Mobile Apps with Red Hat

Cid Santos Luis Matos. Introduction to AllJoyn

Open Sourcing the Internet of Things

IoT Cloud, All Seen Alliance. Masanari Arai 荒 井 真 成 CEO, Kii Corpora0on

Practical Essbase Web Services

Porting Existing PhoneGap Apps to Tizen OS - Development Story

Developing Native JavaScript Mobile Apps Using Apache Cordova. Hazem Saleh

Building Mobile Applications Creating ios applications with jquery Mobile, PhoneGap, and Drupal 7

AllJoyn Android Environment Setup Guide

AQA GCSE in Computer Science Computer Science Microsoft IT Academy Mapping

Developing multidevice-apps using Apache Cordova and HTML5. Guadalajara Java User Group Guillermo Muñoz Java Developer

Android: How To. Thanks. Aman Nijhawan

Your guide to building great apps. Upgrade your skills and update your tools to create the next great app

Mobile Test Automation Framework

Using Extensions or Cordova Plugins in your RhoMobile Application Darryn

opalang - Rapid & Secure Web Development

Getting Started with the Internet Communications Engine

Develop Hybrid Mobile Applications with Apache Cordova & PhoneGap Enterprise

Cloud Powered Mobile Apps with Azure

BASIC COMPONENTS. There are 3 basic components in every Apache Cordova project:

Cross-Platform Development

All About Android WHAT IS ANDROID?

Implementing Mobile Thin client Architecture For Enterprise Application

With a single download, the ADT Bundle includes everything you need to begin developing apps:

Development Techniques for Native/Hybrid Tizen Apps. Presented by Kirill Kruchinkin

The C Programming Language course syllabus associate level

MENDIX FOR MOBILE APP DEVELOPMENT WHITE PAPER

Retool your HTML/JavaScript to go Mobile

Native vs. HTML5 Mobile App Development

Crosswalk: build world class hybrid mobile apps

ios SDK possibilities & limitations

Some Experiences With Python For Android (Py4A) Nik Klever University of Applied Sciences Augsburg

Enterprise Mobile Application Development: Native or Hybrid?

Azure Day Application Development

Out of the Fire - Adding Layers of Protection When Deploying Oracle EBS to the Internet

Introduction to Oracle Mobile Application Framework Raghu Srinivasan, Director Development Mobile and Cloud Development Tools Oracle

AllJoyn Device System Bridge

Programming Mobile Apps with Python

Mobile web apps: The best option for business? A whitepaper from mrc

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

Gerald Kaszuba. Slowchop Studios Director Specialising in Game Design, Architecture, and Development.

How To Develop Android On Your Computer Or Tablet Or Phone

4D Plugin SDK v11. Another minor change, real values on 10 bytes is no longer supported.

Introduction to Android

Mobile Game and App Development the Easy Way

SYST35300 Hybrid Mobile Application Development

AllJoyn Analytics Service Framework 1.0 Interface Definition

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

Cross-Platform Phone Apps & Sites with jquery Mobile

Mobile development with Apache OFBiz. Ean Schuessler, Brainfood

Appery.io Overview. However mobile also presents many challenges for enterprises:

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

Making Mobile a Reality

1. License. Copyright 2016 gamedna studio. All rights reserved.

Splunk for.net Developers

Apache Thrift and Ruby

Database Management System Choices. Introduction To Database Systems CSE 373 Spring 2013

Here to take you beyond Mobile Application development using Android Course details

CS 528 Mobile and Ubiquitous Computing Lecture 2: Android Introduction and Setup. Emmanuel Agu

Computer Science. 232 Computer Science. Degrees and Certificates Awarded. A.S. Degree Requirements. Program Student Outcomes. Department Offices

Best practices building multi-platform apps. John Hasthorpe & Josh Venman

Issues of Hybrid Mobile Application Development with PhoneGap: a Case Study of Insurance Mobile Application

Comparison of Cross-Platform Mobile Development Tools

Beyond The Web Drupal Meets The Desktop (And Mobile) Justin Miller Code Sorcery Workshop, LLC

Mobilize Your ERP with ADF Mobile

CS 378 Big Data Programming. Lecture 9 Complex Writable Types

City of Dublin Education & Training Board. Programme Module for. Mobile Technologies. leading to. Level 6 FETAC. Mobile Technologies 6N0734

Overview. The Android operating system is like a cake consisting of various layers.

What marketing won t tell you about the Internet of Things

Types of Cloud Computing

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

QML and JavaScript for Native App Development

Cross-platform mobile development with Visual C

Mobile App Infrastructure for Cross-Platform Deployment (N11-38)

Transcription:

Using AllJoyn with Apache Cordova, Python & Node Ivan R. Judson, PhD October 2014, Microsoft 13 October 2015 AllSeen Alliance 1

Agenda 1. Background 2. Cordova Plugin 3. Language Bindings Python Bindings Node Bindings 13 October 2015 AllSeen Alliance 2

Background 3

The Goal Accelerate the growth and adoption of AllJoyn by: Enabling more AllJoyn Development Engage more Development Communities Meet Developers where they are Help create a healthy AllJoyn Ecosystem Lots of participants from hardware and services to clients Provide Windows Expertise to the community Provide Knowledge to the community 13 October 2015 AllSeen Alliance 4

Our Strategy Assume Routers provided Deliver tools and software that fills gaps Harden the software Advocate for developers & engineers Windows 10, OS X, Android, OpenWRT Conclusion: Focus on Thin Library 13 October 2015 AllSeen Alliance 5

AllJoyn: Standard vs Thin Standard App Layer App dev or OEM writes this Standard Apps App Layer AllJoyn Standard Standard Service Application Frameworks Layer Thin Apps App Layer AllJoyn Thin Service Frameworks Standard Application Layer Thin App Layer OEM writes this Standard Core Libraries Multiple bindings, runs on HLOS AllJoyn Router AllJoyn Router can be bundled with a Standard App or run standalone AllJoyn Standard Core Libs AllJoyn Router HLOS AllJoyn Thin Core Libs RTOS Physical Layer (Wi-Fi, PLC, Ethernet, Bluetooth) Thin Core Libraries C bindings, runs on RTOS Thin Apps using Thin Core requires an AllJoyn Router in the network 6

Apache Cordova Plugin 7

What is Apache Cordova? Cross Platform Application development Primary Focus: Mobile Native Plugin Support: Geolocation, Accelerometer, Camera, Compass, 13 October 2015 AllSeen Alliance 8

Why Apache Cordova? Write once, run everywhere Java? HTML/JS Skills Required Native Skills Scarce Deep investment by Microsoft 13 October 2015 AllSeen Alliance 9

Apache Cordova AllJoyn https://github.com/alljoyn-cordova/ Apache Cordova Plugin (cordova-plugin-alljoyn) Android, ios, Windows Phone Example Applications Light (cordova-lighting-alljoyn) TV (cordova-tv-alljoyn) Blog posts Documentation 13 October 2015 AllSeen Alliance 10

Cordova AllJoyn Activity 13 October 2015 AllSeen Alliance 11

Apache Cordova Example Applications Using the Apache Cordova Plugin we provide Apache Cordova AllJoyn Light App Luminaire Reference App Compatible Apache Cordova TV App Works with LG TV 13 October 2015 AllSeen Alliance 12

Apache Cordova AllJoyn Plugin: Example > cordova create AllJoyn-Cordova-Example org.alljoyn.cordovaexample "Cordova AllJoyn Example" > cd AllJoyn-Cordova-Example/ > cordova plugin add org.allseen.alljoyn > cordova platform add android > cordova build > cordova run 13 October 2015 AllSeen Alliance 13

Apache Cordova AllJoyn Plugin: Ongoing Published as open source on Github We continue to fix bugs and use it Works with our new Cordova Support in Visual Studio 2015 13 October 2015 AllSeen Alliance 14

Language Bindings 15

Why Bind AJTL To Other Languages? 13 October 2015 AllSeen Alliance 16

Why Bind AJTL To Other Languages? 13 October 2015 AllSeen Alliance 17

Language Bindings In the AllJoyn Standard Library Core: C++ Plus Bindings: Java, JavaScript, Objective-C Deprecated: C#/Unity Meanwhile, in the AllJoyn Thin Library: Core: C Bindings in progress: Python, Node Any SWIG supported language Brook:~ irjudson$ swig help Target Language Options -allegrocl - Generate ALLEGROCL wrap -chicken - Generate CHICKEN wrappe -clisp - Generate CLISP wrappers -cffi - Generate CFFI wrappers -csharp - Generate C# wrappers -d - Generate D wrappers -go - Generate Go wrappers -guile - Generate Guile wrappers -java - Generate Java wrappers -javascript - Generate Javascript wra -lua - Generate Lua wrappers -modula3 - Generate Modula 3 wrapp -mzscheme - Generate Mzscheme wrapp -ocaml - Generate Ocaml wrappers -octave - Generate Octave wrapper -perl - Generate Perl wrappers -php - Generate PHP wrappers -pike - Generate Pike wrappers -python - Generate Python wrapper -r - Generate R (aka GNU S) -ruby - Generate Ruby wrappers -sexp - Generate Lisp S-Express -tcl - Generate Tcl wrappers -uffi - Generate Common Lisp / -xml - Generate XML wrappers 13 October 2015 AllSeen Alliance 18

My Approach: SWIG SWIG => SoftWare Interface Generator, http://swig.org/ David Beazley, author Driven by an interface file, which can be auto generated in simple cases. %module example %{ /* Includes the header in the wrapper code */ #include "header.h" % } /* Parse the header file to generate wrappers */ %include "header.h 13 October 2015 AllSeen Alliance 19

My Approach: SWIG 11:47 $ scons WS=off LANG=python scons: Reading SConscript files... 11:47 $ cd swig/python/ 11:47 $ ls _alljoyn.so basic_service.py marshal_client.py alljoyn.py int marshal_service.py alljoyn.pyc int.c marshal_test.py basic_client.py marshal.i 13 October 2015 AllSeen Alliance 20

Status: Almost there! Progress is slow, but steady. Working on Python first. Debugging a structure marshaling / unmarshaling issue with the message header (endianess specifically). Finishing the marshaling of basic types for Python Then Node, etc https://jira.allseenalliance.org/browse/asacore-1060 My issue to resolve the outstanding issues with language bindings 13 October 2015 AllSeen Alliance 21

Python Bindings 22

AllJoyn Messages AllJoyn Services and Clients communicate by sending messages Messages generally have the form of headers and payloads The payloads are Marshaled (encoded safely for types) when sent The recipient needs to be able to Unmarshal the messages Here are the signatures of all the messages found in the AJTL: # (ayay) # (ii) # (usay) # (vvvvvv) # au # ay # ays # b # I # ii # o # q # qq # qsq # s # sq # ss # sss # su # u # u(usu(ii)qsq)yyy # uq # us # usu # uu # v # y # ys # yyy # {iv} # {s(us)} # {sv} # {us} # {ys} 13 October 2015 AllSeen Alliance 23

Data Marshaling /* * Message argument types */ #define AJ_ARG_INVALID '\0' /**< AllJoyn invalid type */ #define AJ_ARG_ARRAY 'a' /**< AllJoyn array container type */ #define AJ_ARG_BOOLEAN 'b' /**< AllJoyn boolean basic type */ #define AJ_ARG_DOUBLE 'd' /**< AllJoyn IEEE 754 double basic type */ #define AJ_ARG_SIGNATURE 'g' /**< AllJoyn signature basic type */ #define AJ_ARG_HANDLE 'h' /**< AllJoyn socket handle basic type */ #define AJ_ARG_INT32 'i' /**< AllJoyn 32-bit signed integer basic type */ #define AJ_ARG_INT16 'n' /**< AllJoyn 16-bit signed integer basic type */ #define AJ_ARG_OBJ_PATH 'o' /**< AllJoyn Name of an AllJoyn object instance basic type */ #define AJ_ARG_UINT16 'q' /**< AllJoyn 16-bit unsigned integer basic type */ #define AJ_ARG_STRING 's' /**< AllJoyn UTF-8 NULL terminated string basic type */ #define AJ_ARG_UINT64 't' /**< AllJoyn 64-bit unsigned integer basic type */ #define AJ_ARG_UINT32 'u' /**< AllJoyn 32-bit unsigned integer basic type */ #define AJ_ARG_VARIANT 'v' /**< AllJoyn variant container type */ #define AJ_ARG_INT64 'x' /**< AllJoyn 64-bit signed integer basic type */ #define AJ_ARG_BYTE 'y' /**< AllJoyn 8-bit unsigned integer basic type */ #define AJ_ARG_STRUCT '(' /**< AllJoyn struct container type */ #define AJ_ARG_DICT_ENTRY '{' /**< AllJoyn dictionary or map container type */ 13 October 2015 AllSeen Alliance 24

Data Marshaling Language specific Not all types map uniquely Luckily there aren t that many types switch(signature[i]) { case 'y': printf("got a byte: "); arg.val.v_data = (void *)PyInt_AsLong(o); printf("%d\n", (int)arg.val.v_byte); break; case 'q': printf("got a 16-bit unsigned integer: "); arg.val.v_data = (void *)PyInt_AsLong(o); printf("%d\n", (int)arg.val.v_uint16); break; case 'u': printf("got a 32-bit unsigned integer: "); arg.val.v_data = (void *)PyInt_AsLong(o); printf("%d\n", (int)arg.val.v_uint32); break; case 't': printf("got a 64-bit unsigned integer: "); arg.val.v_data = (void *)PyInt_AsLong(o); printf("%d\n", (int)arg.val.v_uint64); break; } 13 October 2015 AllSeen Alliance 25

Example: Basic Service Switch to editor 13 October 2015 AllSeen Alliance 26

Example: Basic Client Switch to editor 13 October 2015 AllSeen Alliance 27

Node Bindings 28

Example: Basic Service Switch to editor 13 October 2015 AllSeen Alliance 29

Example: Basic Client Switch to editor 13 October 2015 AllSeen Alliance 30

In closing We are here to help We have experience with all the platforms, lots of data, and software. We ll work with you where you are We are platform agnostic. You don t have to learn a new language You can use AllJoyn with C, C++, Objective-C, JavaScript, Python, Node, more every day. 13 October 2015 AllSeen Alliance 31

Thank you Follow us on For more information on AllSeen Alliance, visit us at: allseenalliance.org & allseenalliance.org/news/blogs 13 October 2015 AllSeen Alliance 32