phonegap –an overview · introduction to mobile os cross platform frameworks introduction to...

27

Upload: others

Post on 22-May-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap
Page 2: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

Introduction to Mobile OS

Cross platform frameworks

Introduction to PhoneGap

Features of PhoneGap

Developing an Android app using PhoneGap

Page 3: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

3

Page 4: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

4

Page 5: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

Native (Android –java)

Web (HTML ,CSS and JS)

Hybrid (PhoneGap)

Performance Fast Moderate Moderate

Easy to learn

Hard Easy Easy

Supports native functionality

All No Most

Time to create app

Long Short Short

Page 6: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

6

Page 7: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

Cross-platform framework used for developing applications for mobile devices using HTML,CSS and .JavaScript.

http://phonegap.com

Page 8: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

It’s goal is to make local Web applications to have the same functionality as native applications.

Free and open Source framework.

Bridges the gap between web applications and mobile devices.

Page 9: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap
Page 10: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

HTML5/CSS 3 Application

UI Framework PHONEGAP API

PHONEGAP BRIDGE

GPS

FILESYSTEM SQLITE Etc..

MEDIA CAMERA

Page 11: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

The downloaded PhoneGap library has different folder for each supported platform

Page 12: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

The phoneGap-Android folder has two files:

◦ phoneGap.js

Used to access native API in application

◦ phonegap.jar

Includes the classes required to work with phonegap.

Page 13: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap
Page 14: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

Accelerometer API function onSuccess(acceleration) {

alert('Acceleration X: ' + acceleration.x + '\n' + 'Acceleration Y: ' + acceleration.y + '\n' + 'Acceleration Z: ' + acceleration.z + '\n' + 'Timestamp: ' + acceleration.timestamp + '\n'); }; function onError() { alert('onError!'); }; navigator.accelerometer.getCurrentAcceleration(onSuccess, onError);

Page 15: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

Geolocation API

//onSuccess Callback

var onSuccess = function(position) {

alert('Latitude: ' + position.coords.latitude + '\n' +

'Longitude: ' + position.coords.longitude + '\n' +

'Altitude: ' + position.coords.altitude + '\n' +

'Timestamp: ' + new Date(position.timestamp) + '\n');

};

function onError(error) {

alert('code: ' + error.code + '\n' +

'message: ' + error.message + '\n');

}

navigator.geolocation.getCurrentPosition(onSuccess, onError);

Page 16: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

Contacts API function onDeviceReady(){ // find all contacts var options = new ContactFindOptions(); options.filter=""; //fetch all contacts var fields = ["phoneNumbers", "name"]; //which fields to fetch navigator.contacts.find(fields, onSuccess, onError, options); }

Page 17: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

Files API

window.requestFileSystem(LocalFileSystem.PERSISTENT,0,onSuccess,onFail) function onSuccess(fileSystem) { alert(fileSystem.name); alert(fileSystem.root.name); } function onFail(event) { alert(event.target.error.code); }

Page 18: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

https://build.phonegap.com/apps

Page 19: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

Used to access some platform specific functionality

List of current plugins: ◦ http://github.com/phonegap/phonegap-

plugins Barcode Scanner ChildBrowser ClipBoard Manager PayPal Etc…

Page 20: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap
Page 21: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap
Page 22: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

A UI development framework that allows to develop mobile web applications that work across smartphones and tablets.

http://jquerymobile.com

Page 23: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

Pages and Dialogs

Form Controls

Buttons

Toolbars

ListView control

Page 24: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

<div data-role="page">

<div data-role="header">

<h1>Page Title</h1>

</div>

<div data-role="content">

<p>Page content</p>

</div>

<div data-role="footer">

<h4>Page Footer</h4>

</div> </div>

Page 25: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap
Page 26: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

Q & A

Page 27: PhoneGap –An Overview · Introduction to Mobile OS Cross platform frameworks Introduction to PhoneGap Features of PhoneGap Developing an Android app using PhoneGap

THANK YOU