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



Similar documents
SYST35300 Hybrid Mobile Application Development

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

Retool your HTML/JavaScript to go Mobile

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

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

Developing and deploying mobile apps

ios SDK possibilities & limitations

Developing Native JavaScript Mobile Apps Using Apache Cordova. Hazem Saleh

Porting Existing PhoneGap Apps to Tizen OS - Development Story

place/business fetch details, removefromfavorite () function, 189 search button handler bind, B BlackBerry build environment

Lecture 4 Cross-Platform Development. <lecturer, date>

Cross-Platform Phone Apps & Sites with jquery Mobile

White Paper INTRODUCTION. In mobile development, there are three different types of applications: PRE-SMARTPHONE MOBILITY NATIVE MOBILE APPLICATIONS

Development for Mobile Devices Tools from Intel, Platform of Your Choice!

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

The Bootstrapper's Guide to the Mobile Web by Deltina Hay. Mobile App Strategy Worksheet. I. Target Market, App Category, Platforms

Smartphone Application Development using HTML5-based Cross- Platform Framework

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

Cross-Platform Development

The Suitability of Native Application for University E-Learning Compared to Web-Based Application

Navigating the Mobile App Development Landscape

Building native mobile apps for Digital Factory

Multi-Platform Mobile Application Development Analysis. Lisandro Delía Nicolás Galdámez Pablo Thomas Leonardo Corbalán Patricia Pesado

the intro for RPG programmers Making mobile app development easier... of KrengelTech by Aaron Bartell

An Analysis of Mobile Application Development Approaches

Mobile Learning Application Based On Hybrid Mobile Application Technology Running On Android Smartphone and Blackberry

CROSS PLATFORM APP A COMPARATIVE STUDY

Introduction to PhoneGap

How to Choose Right Mobile Development Platform BROWSER, HYBRID, OR NATIVE

Crosswalk: build world class hybrid mobile apps

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

MENDIX FOR MOBILE APP DEVELOPMENT WHITE PAPER

CiviMobile & CiviSync Mobile. Peter McAndrew Rohit Thakral

HTML5 / NATIVE / HYBRID

CROSS PLATFORM DEVELOPMENT The HTML5 Way

Develop Hybrid Mobile Applications with Apache Cordova & PhoneGap Enterprise

How To Develop A Mobile App With Phonegap

Mobile Cross Platform Development really? Jonathan Marshall, IBM Mobile Technical Specialist IBM Corporation

WEB, HYBRID, NATIVE EXPLAINED CRAIG ISAKSON. June 2013 MOBILE ENGINEERING LEAD / SOFTWARE ENGINEER

True Web Application Management: Fixing the Gaps in EMM Solutions

max firt.mobi martes 26 de julio de 11

Making Mobile a Reality

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

HYBRID APPLICATION DEVELOPMENT IN PHONEGAP USING UI TOOLKITS

To Study and Design a Cross-Platform Mobile Application for Student Information System using PhoneGap Framework

research: technical implemenation

Cross-Platform Tools

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

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

ANDROID APP DEVELOPMENT: AN INTRODUCTION CSCI /19/14 HANNAH MILLER

Cross-Platform Development: Target More Platforms and Devices with a Minimal Amount of Source Code

How to pick the right development model for your next mobile project

PhoneGap Build Starter

Take full advantage of IBM s IDEs for end- to- end mobile development

APEX World 2013 APEX & Christian Rokitta. OGh APEX World 9 April 2013

All About Android WHAT IS ANDROID?

Native, web or hybrid mobile-app development

Extending Tizen Native Framework with Node.js

POINT-TO-POINT vs. MEAP THE RIGHT APPROACH FOR AN INTEGRATED MOBILITY SOLUTION

Cross-Platform Mobile Geolocation Applications Based on PhoneGap

Cross-Platform Mobile Application Development

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

How To Develop Android On Your Computer Or Tablet Or Phone

Introduction to IBM Worklight Mobile Platform

Comparison of Cross-Platform Mobile Development Tools

Mobile Application Development. Adopt Based On Fit

OpenEdge and Mobile Applications

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

Mobile Development Frameworks Overview. Understand the pros and cons of using different mobile development frameworks for mobile projects.

A Way Out of the Mobile App Development Conundrum

MOBILE APPLICATION - CROSS DOMAIN DEVELOPMENT AND STUDY OF PHONEGAP

HTML5 and Device APIs for Automotive: Is it time to power Infotainment and Car Portal Applications with Web Technologies?

HP ALM Masters 2014 Connected, collaborative mobile application development for the enterprise HP Anywhere

Accelerating Business Value by

Dealing with the Dilemma: Mobile App Development Approach & Decisions

Considerations Regarding the Cross-Platform Mobile Application Development Process

How To Use Titanium Studio

Enterprise Mobile App Management Essentials. Presented by Ryan Hope and John Nielsen

A Guide to Mobile App Development Platforms

DEVELOPING NFC APPS for BLACKBERRY

DevOps Best Practices for Mobile Apps. Sanjeev Sharma IBM Software Group

UX & Cross-Platform Mobile Application Development Frameworks

Analysis of Cross-Platform Development Frameworks for a Smartphone Pediatric Application

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

Native, Hybrid or Mobile Web Application Development

Adobe Experience Manager Apps

ADF Mobile Overview and Frequently Asked Questions

SAP Mobile Platform Intro

Development of Hybrid Applications with HTML

Transcription:

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

What is Cordova (aka PhoneGap)? An open-source standards-based development framework for building cross-platform mobile applications using HTML, CSS and JavaScript An attempt to unify third-party application development across different mobile platforms and to supplement existing standards with new JavaScript APIs for mobile development 2

What is Cordova (aka PhoneGap)? A means to author native applications with web technologies A way to deploy web apps on multiple platforms. This can be done using the PhoneGap build service that creates app-store ready apps : «write once, compile in the cloud, run anywhere» Official web site : www.phonegap.com 3

Cordova, a bit of history Initially called PhoneGap, i.e. bridging the Web API gap for Phone. It was later renamed Cordova Founded by the Nitobi Software company, then acquired by Adobe in Oct. 2011. Open-source licensing model is Apache 2.0 Applied to contribute to the Apache Software Foundation and currently in the Incubation stage : see http://incubator.apache.org/cordova/ 4

Cordova Supported features ios Android RIM OS WebOS WP7 Symbian Bada Accelerometer Camera Compass Contacts Files Geolocation Media Network Notification-alert Notification-sound Notification-vibrate Storage Source : http://phonegap.com/about/features 5

Why port Cordova to Tizen? Most popular cross-platform way of developing and packaging hybrid apps Establish Tizen as a global open-source web platform Allow Tizen devices to run the Cordova apps portfolio and to leverage the Cordova ecosystem Benefit from the PhoneGap build system s ability to deploy web apps on other platforms supported by Cordova 6

Main reference implementations Native platform code with HTML5/JS/CSS code inside fullscreen WebView instantiated from native code with mechanisms to bridge between native code <-> javascript code bridge mechanisms depending on platform WebView implementations features examples : ios (ObjectiveC and WebView Control + gap:// protocol), Android (Java and WebView Control + gap:// protocol ), BlackBerry (Java and WebView Control + BlackBerry WebWorks JavaScript Extension) JavaScript shim layer 7

JavaScript shim layer We opted for a shim layer = set of JavaScript libraries mapping/wrapping Cordova Web API on top of Tizen Web APIs Pros Cons relies on the Tizen public SDK easier to implement thin adaptation layer on top of Tizen convenient to package, build and test (Tizen.wgt format) proven by WebOS and Symbian limited to the capabilities exposed by Tizen Web APIs no extensibility to new platform services 8

Cordova and Tizen Web APIs mapping Cordova Tizen Accelerometer W3C Device Orientation API Compass W3C Device Orientation API Geolocation W3C Geolocation API Device Tizen System Information API Connection W3C Network Information API Storage W3C WebStorage/WebSQL API Files W3C File/Directories/Writer API Notifications HTML5/W3C Vibration API Events Tizen System Information API (Battery ) Contacts Tizen Contacts Web API Camera Tizen Application Web API or W3C HTML5 Media Capture Capture Tizen Application Web API or W3C HTML5 Media Capture Media Tizen Application Web API or W3C HTML5 Audio 9

Cordova sample application <!DOCTYPE html> <html lang="en"> <head> <script src="cordova.js"></script> </head> <body> <script> document.addeventlistener('deviceready', function () { console.log("cordova is ready for platform " + window.device.platform + " v" + window.device.version + "!"); // Cordova is ready, do all your Cordova stuff here }, false); </script> </body> </html> 10

Common code VS host specific code 11

Generic Cordova JS code (common) //...full code not included... Battery.prototype.onSubscribe = function() { var me = battery; // If we just registered the first handler, make sure native listener is started. if (handlers() === 1) exec(me._status, me._error, "Battery", "start", []); }; Battery.prototype.onUnsubscribe = function() { var me = battery; // If we just unregistered the last handler, make sure native listener is stopped. if (handlers() === 0) exec(null, null, "Battery", "stop", []); }; 12

Battery shim layer (Tizen-specific) var id = null; module.exports = { start: function(successcb, failcb) { var tizensuccesscb = function(power) { if (successcb) }; successcb({level: Math.round(power.level * 100), isplugged: power.ischarging}); if (id === null) id = tizen.systeminfo.addpropertyvaluechangelistener("power", tizensuccesscb); tizen.systeminfo.getpropertyvalue("power", tizensuccesscb, failcb); }, stop: function(successcb, failcb) { tizen.systeminfo.removepropertyvaluechangelistener(id); id = null; } }; 13

JS plug-in manager (Tizen-specific) var cordova = require('cordova'); module.exports = { }; exec: function (successcb, failcb, clazz, action, args) { var plugin = require('cordova/plugin/tizen/' + clazz); } if (plugin && typeof plugin[action] === 'function') { var result = plugin[action](successcb, failcb, args); return result {status: cordova.callbackstatus.no_result}; return {"status" : cordova.callbackstatus.class_not_found_exception, "message" : "Function " + clazz + "::" + action + " cannot be found"}; } 14

Implementing as native hybrid apps Native Tizen EFL application instantiating an Elementary web view widget that renders/executes the Cordova web app embedded in its resources (HTML/ JavaScript/CSS) Bridge mechanism and protocol allowing interactions between JavaScript and native code in both directions. - JS Native: Document title changed hook native callback - Native JS: ewk_frame_script_execute(webkit, javascript_code) - Gap protocol: gap://service/action/request_id/[json arguments] Cordova API services implementation based on native Tizen SDK (instead of Tizen Web API SDK) 15

JS -> Native: exec.js module.exports = function(success, fail, service, action, args) { try { }; // Generate a command unique ID (transaction ID) var cmdid = service + cordova.callbackid++; // Register the command callbacks (to be called by native side) if (success fail) cordova.callbacks[cmdid ] = {success:success, fail:fail}; // Build gap URI (gap://accelerometer/getacceleration/accelerometer0/[]) var command = service + "/" + action + "/" + cmdid + "/" + JSON.stringify(args); // Change the document title to trigger our hook callback on native side document.title = "gap://" + command; Native -> JS return null; } catch (e) { utils.alert("error: " + e); } 16

Native -> JS Once processed by native side, a command request reply is sent back to the JS side by asking its registered JS callbacks execution. cordova.callbacksuccess(<callback_id>, {status:<status>,message:<result_message>,keepcallback:<true_or_false>}); cordova.callbackserror(<callback_id>, {code:<error_code>,message:<error_message>}); Native side: ewk_frame_script_execute(main_frame, "cordova.callbacksuccess('accelerometer0',{status:'1',message:{x:1.23,y:4.56,z :7.89}, keepcallback:'false'});"); 17

Current status Code has been public since 03/13, as announced on the Cordova mailing list https://github.com/otcshare/cordova-tizen Cordova Hybrid Application feasibility completed prototype done pending questions about security policy 18

Current status APIs fully ported (shim layer) Accelerometer, Compass, Geolocation, Device, Storage, Files, Notifications, Power events APIs in progress (shim layer) Events, Camera, Contacts, Capture, Media 19

Next steps Complete the missing APIs switch/upgrade to SDK 1.0 Larkspur try to hit June target Get Cordova Tizen project hosted by the Apache Software Foundation will require to sign ICLA/CLA will need approval from Cordova «mentors» 20

Next steps Complete the support of Cordova Hybrid applications clarify strategy about native Tizen development kit/native apps complete prototype to replace shim layer (TBC) Add Cordova Tizen build capabilities to PhoneGap build services once our port to Tizen is completed and reliable meet with Cordova people to put it in place 21

Time for a demo 22

Thanks for your attention! Q & A 23

Contacts for Dev team Email us at : paul.plaquette@intel.com regis.merlino@intel.com christophe.guiraud@intel.com Intel Software Engineer Intel Software Engineer Intel Software Engineer rene.pourtier@intel.com Intel Engineering Manager 24