Developing Native JavaScript Mobile Apps Using Apache Cordova. Hazem Saleh



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

Introduction to PhoneGap

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

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

Mobile Web Applications using HTML5. L. Cotfas 14 Dec. 2011

PhoneGap. Cross-platform Programming Lecture 2. Alessandro Grazioli. Università Degli Studi di Parma. Distributed Systems Group

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

Retool your HTML/JavaScript to go Mobile

Developing and deploying mobile apps

SYST35300 Hybrid Mobile Application Development

Building a Simple Mobile optimized Web App/Site Using the jquery Mobile Framework

Developing Exceptional Mobile and Multi-Channel Applications using IBM Web Experience Factory

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

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

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

ios SDK possibilities & limitations

Operational Decision Manager Worklight Integration

ITG Software Engineering

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

Adobe Summit 2015 Lab 712: Building Mobile Apps: A PhoneGap Enterprise Introduction for Developers

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

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

Mobile development with Apache OFBiz. Ean Schuessler, Brainfood

Lab: Developing Mobile Web Apps. Adage Technologies adagetechnologies.com

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

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

Build a Mobile App in 60 Minutes with MAF

Cross-Platform Phone Apps & Sites with jquery Mobile

Mobile Application Development

Developing Exceptional Mobile and Multi-Channel Applications using IBM Web Experience Factory IBM Corporation 1

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

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

Viability of developing cross-platform mobile business applications using a HTML5 Mobile Framework

Build your own Fiori hybrid mobile app rapidly using SAP Web IDE Marc Anderegg, SAP SESSION CODE: BT404

Introduction to Tizen SDK Alpha. Taiho Choi Samsung Electronics

CiviMobile & CiviSync Mobile. Peter McAndrew Rohit Thakral

Building native mobile apps for Digital Factory

How To Develop A Mobile App With Phonegap

Enterprise Mobile Application Development: Native or Hybrid?

HYBRID APPLICATION DEVELOPMENT IN PHONEGAP USING UI TOOLKITS

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)

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

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

Develop Hybrid Mobile Applications with Apache Cordova & PhoneGap Enterprise

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

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

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

Cross-Platform Development

Introduction to Android

Generate Android App

max firt.mobi martes 26 de julio de 11

MOBILIZING ORACLE APPLICATIONS ERP. An Approach for Building Scalable Mobility Solutions. A RapidValue Solutions Whitepaper

unisys ClearPath eportal Developer 6.1 Unisys Multi-Device App Developer s Guide March

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

Crosswalk: build world class hybrid mobile apps

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

Develop IBM i Mobile and Desktop Applications with a Single Code Base. BCD Software, LLC. All rights reserved.

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

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

... Introduction Acknowledgments... 19

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

QML and JavaScript for Native App Development

How To Use Titanium Studio

All About Android WHAT IS ANDROID?

Dave Haseman, Ross. Hightower. Mobile Development for SAP* ^>. Galileo Press. Bonn. Boston

Smartphone Application Development using HTML5-based Cross- Platform Framework

Android (Basic + Advance) Application Development

How To Run A Hello World On Android (Jdk) On A Microsoft Ds.Io (Windows) Or Android Or Android On A Pc Or Android 4 (

Navigating the Mobile App Development Landscape

An Analysis of Mobile Application Development Approaches

ADF Mobile Overview and Frequently Asked Questions

MicroStrategy Course Catalog

Choosing a Mobile Strategy for Your Business

IBM Watson Ecosystem. Getting Started Guide

ios App Development Using Cordova

Extending Tizen Native Framework with Node.js

ORACLE MOBILE APPLICATION FRAMEWORK DATA SHEET

Building Apps for iphone and ipad. Presented by Ryan Hope, Sumeet Singh

research: technical implemenation

Mobile App Development

Petroleum Web Applications to Support your Business. David Jacob & Vanessa Ramirez Esri Natural Resources Team

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

Designing for the Mobile Web Lesson 3: HTML5 Web Apps

What s New in IBM Web Experience Factory IBM Corporation

Republic Polytechnic School of Infocomm C308 Web Framework. Module Curriculum

Mobile App Design and Development

RFP# ADDENDUM No. 1 Questions and Answers

Android Programming: Installation, Setup, and Getting Started

Mobile Application Development

Des Moines Area Community College

Development Techniques for Native/Hybrid Tizen Apps. Presenter Matti Pakarinen

MENDIX FOR MOBILE APP DEVELOPMENT WHITE PAPER

Mobile Website Design for Libraries

Transcription:

Developing Native JavaScript Mobile Apps Using Apache Cordova Hazem Saleh

About Me Ten years of experience in Java enterprise, portal, mobile solutions. Apache Committer and an open source fan. Author of three books. DeveloperWorks Contributing author. Technical Speaker. Advisory Software Engineer in IBM.

Agenda Apache Cordova Introduction Configurations Cordova Command Line Cordova APIs Overview jquery Mobile Integration Memo Application Demo

Apache Cordova Introduction HTML CSS JS Platform

Apache Cordova Introduction Device native functions examples:

Apache Cordova Introduction Hybrid vs Native Application Hybrid Application (Cordova) Native Application Can be uploaded to App Store Yes Yes Technology HTML + CSS + JavaScript Native platform Programming Language Cross-mobiles support Yes No Development Speed Faster Slower Uses Device Native Features Yes Yes

Apache Cordova Introduction Cordova is supported on the following platforms:

Apache Cordova Introduction Challenges of the current mobile development: Many platforms and devices. For Android: Java skills needed. Different skills needed. For ios: Objective C skills needed. For Windows:.Net skills needed. Different problem types. Huge Development and Testing Effort to have a single application on these platforms.

Apache Cordova Introduction Who can use Cordova? If you are a web developer and wants to develop a mobile application that can be deployed on the different app store portals. If you are a mobile native developer and wants to develop a single application on the different mobile platforms without having to reimplement the application code on every platform.

Agenda Apache Cordova Introduction Configurations Cordova Command Line Cordova APIs Overview jquery Mobile Integration Memo Application Demo

Configuration Prerequisites: Node JS. Target SDK. From command line: > sudo npm install -g cordova To know the installed version of Cordova: > cordova -v

Agenda Apache Cordova Introduction Configurations Cordova Command Line Cordova APIs Overview jquery Mobile Integration Memo Application Demo

Cordova Command Line To create an application: > cordova create <<app_dir>> <<project_id>> <<app_title>> To add a platform (from the app folder): > cordova platform add <<platform_name>> To build Cordova project: > cordova build To deploy the app on emulator: > cordova emulate <<platform_name>>

Hello World Demo

Agenda Apache Cordova Introduction Configurations Cordova Command Line Cordova APIs Overview jquery Mobile Integration Memo Application Demo

Cordova APIs Overview Native device functions are represented as plugins that can be added and removed using the command line. Adding camera plugin example: > cordova plugin add https://git-wip-us-apache.org/repos/asf/cordovaplugin-camera.git Removing Camera plugin example: > cordova plugin rm org.apache.cordova.core.camera

Cordova APIs Overview Device An object that holds information about the device hardware and software. Device information is mainly about: Device name. Device Platform. Device Platform version. Device model. deviceready event is an indicator that Cordova finishes loading and Cordova APIs are ready to be called.

Cordova APIs Overview Camera An object that provides an access to the default camera application. navigator.camera.getpicture(onsuccess, onfail, { quality: 50, destinationtype: Camera.DestinationType.DATA_URL }); function onsuccess(imagedata) { var image = document.getelementbyid('myimage'); image.src = "data:image/jpeg;base64," + imagedata; } function onfail(message) { alert('failed because: ' + message); }

Cordova APIs Overview Capture An object that provides an access to audio, image, and video capture capabilities. var capturesuccess = function(mediafiles) { // Do something with the captured Audio media files }; var captureerror = function(error) { navigator.notification.alert('error code: ' + error.code, null, 'Capture Error'); }; navigator.device.capture.captureaudio(capturesuccess, captureerror, {limit:2});

Cordova APIs Overview Media An object that allows playing back audio files on the device. var my_media = new Media("someFile.mp3", onsuccess, onerror); my_media.play(); function onsuccess() { console.log("playaudio():audio Success"); } function onerror(error) { alert('code: ' + error.code + '\n' + 'message: ' + error.message + '\n'); }

Cordova APIs Overview Notification An object that displays visual, audible, and tactile notification. // Show a native looking alert navigator.notification.alert( 'Cordova is great!', // message 'Cordova', // title 'Ok' // buttonname ); // Beep four times navigator.notification.beep(4); // Vibrate for 3 seconds navigator.notification.vibrate(3000);

Cordova APIs Overview Storage Provides an access to the W3C Web Storage interface: - Local Storage (window.localstorage). - Session Storage (window.sessionstorage). window.localstorage.setitem("key", "value"); var value = window.localstorage.getitem("key"); window.localstorage.removeitem("key"); window.localstorage.clear();

Cordova APIs Overview Storage Provides an access to the device Web SQL Database (Full featured database). function populatedb(tx) { tx.executesql('drop TABLE IF EXISTS DEMO'); tx.executesql('create TABLE IF NOT EXISTS DEMO (id unique, data)'); tx.executesql('insert INTO DEMO (id, data) VALUES (1, "First row")'); tx.executesql('insert INTO DEMO (id, data) VALUES (2, "Second row")'); } function errorcb(err) { alert("error processing SQL: " + err.code); } function successcb() { alert("success!"); } var db = window.opendatabase("demos", "1.0", "Cordova Demo", 200000); db.transaction(populatedb, errorcb, successcb);

Cordova APIs Overview Geolocation Provides an access to location data (based on GPS sensor or inferred from Network signal). var onsuccess = function(position) { alert('latitude: ' + position.coords.latitude + '\n' + 'Longitude: ' + position.coords.longitude + '\n'); }; function onerror(error) { alert('code: ' + error.code + '\n' + 'message: ' + error.message + '\n'); } navigator.geolocation.getcurrentposition(onsuccess, onerror);

Cordova APIs Overview More Objects: Accelerometer (Capture device motion) Compass (Get the device direction) Connection (Get the device connection) Contacts (Access to device contacts database). File (Access to device File system based on W3C File API) Globalization (Access to user locale information)

Agenda Apache Cordova Introduction Configurations Cordova Command Line Cordova APIs Overview jquery Mobile Integration Memo Application Demo

jquery Mobile Integration jquery Mobile is one of the most popular User Interface framework for building Mobile Web applications. jquery Mobile uses HTML5 + CSS3 for layout pages with minimal scripting. It is compatible with most of the mobile and tablet browsers.

jquery Mobile Integration Cordova does not restrict using any specific JavaScript library but using a JavaScript library will save you a lot of time creating your own widgets from scratch. jquery Mobile is used in the demo application with Cordova to create the Memo application.

jquery Mobile Integration In order to boost the performance of jquery mobile with Cordova, it is recommended to disable transition effects as follows (jquery mobile 1.4): $.mobile.defaultpagetransition = 'none'; $.mobile.defaultdialogtransition = 'none';

Agenda Apache Cordova Introduction Configurations Cordova Command Line Cordova APIs Overview jquery Mobile Integration Memo Application Demo

Memo Application GitHub project: http://github.com/hazems/memo Running Android project: http://apps.opera.com/en_eg/memos_free_version.html

Questions???