building mobile apps using phonegap

49
BUILDING MOBILE APPS USING PHONEGAP Saidur Rahman Bijon Md. Shoriful Islam Ronju

Upload: mohammad-shoriful-islam-ronju

Post on 09-May-2015

5.584 views

Category:

Self Improvement


3 download

DESCRIPTION

Building mobile applications using HTML5, CSS3, Javascript and PhoneGap.

TRANSCRIPT

Page 1: Building mobile apps using Phonegap

BUILDING MOBILE APPS USING PHONEGAP

Saidur Rahman BijonMd. Shoriful Islam Ronju

Page 2: Building mobile apps using Phonegap

Presentation outline

What is PHONEGAP? Why PHONEGAP? Features? What do you need to develop in

PHONEGAP? Development steps Resources Sample app Deploy in Device Questions and Answer.

Page 3: Building mobile apps using Phonegap

What is PHONEGAP?

Page 4: Building mobile apps using Phonegap

What is PhoneGap

Page 5: Building mobile apps using Phonegap

What is PHONEGAP?

Page 6: Building mobile apps using Phonegap

PhoneGap Apps

3 Card Poker Dairy Orbium Puzzle

City TouchChessLogitech Squeezebox

Page 7: Building mobile apps using Phonegap

Supported mobile platforms ….

Why PHONEGAP?

Page 8: Building mobile apps using Phonegap

Why PHONEGAP?

Page 9: Building mobile apps using Phonegap

Why PHONEGAP?

Total: 600,000Monthly: 44,000

Page 10: Building mobile apps using Phonegap

Why PHONEGAP?

Page 11: Building mobile apps using Phonegap

Why PHONEGAP?

Page 12: Building mobile apps using Phonegap

Why PHONEGAP?

Page 13: Building mobile apps using Phonegap

PHONEGAP Features

Accelerometer Camera Compass Contacts File

Geolocation Media Network Storage Notifications

Page 14: Building mobile apps using Phonegap

What do you need to develop in PHONEGAP?

For iOS Development•Xcode•iOS SDK

For Android•Android SDK•ADT plugin

For BlackBerry•Sun SDK•Apache ant•BlackBerry WebWorks SDK

For Symbian•SDK

PHONEGAP Build

Page 15: Building mobile apps using Phonegap

Setup PhoneGap

Page 16: Building mobile apps using Phonegap

Development steps for iPhone

Page 17: Building mobile apps using Phonegap

Development steps for iPhone

Page 18: Building mobile apps using Phonegap

Development steps for iPhone

Page 19: Building mobile apps using Phonegap

Development steps for iPhone

Page 20: Building mobile apps using Phonegap

Development steps for iPhone

Page 21: Building mobile apps using Phonegap

PHONEGAP

Accelerometer Camera Compass Contacts File

Geolocation Media Network Storage Notifications

Page 22: Building mobile apps using Phonegap

SAMPLE APPLICATION

Page 23: Building mobile apps using Phonegap

SAMPLE APPLICATION : NOTIFICATION

Page 24: Building mobile apps using Phonegap

INDEX.HTML ( CONTİNUE ...)

<script type="text/javascript” src="phonegap.0.9.6.min.js"></script><body onload="onBodyLoad()">

Page 25: Building mobile apps using Phonegap

NOTIFICATION ( CONTİNUE ...)

navigator.notification.alert (‘msg’);

document.addEventListener ("deviceready",onDeviceReady,false);

Page 26: Building mobile apps using Phonegap

NOTIFICATION (CONTİNUE..)

function onDeviceReady() {// do your thing!

navigator.notification.alert(”Phonegap is working");

}

Page 27: Building mobile apps using Phonegap

Notification

Page 28: Building mobile apps using Phonegap

Sample Application: Accelerometer

Page 29: Building mobile apps using Phonegap

ACCELEROMETER ( CONTİNUE ...)

Page 30: Building mobile apps using Phonegap

Navigator.accelerometer.getCurrentAcceleration()

Captures device motion in the x, y, and z direction.

ACCELEROMETER API ( CONTİNUE ...)

Page 31: Building mobile apps using Phonegap

function onDeviceReady() { navigator.accelerometer.getCurrentAcceleration (onSuccess,onError);}

ACCELEROMETER API ( CONTİNUE ...)

Page 32: Building mobile apps using Phonegap

function onSuccess(acceleration) { $(‘#id’).('Acceleration X: ' + acceleration.x + 'Acceleration Y: ' + acceleration.y + 'Acceleration Z: ' + acceleration.z + ); }

ACCELEROMETER API ( CONTİNUE ...)

Page 33: Building mobile apps using Phonegap

ACCELEROMETER (CONTINUE..)

Page 34: Building mobile apps using Phonegap

STORAGE API

Access to the W3C Web storage.

Page 35: Building mobile apps using Phonegap

SAMPLE APPLICATION : STORAGE API

Page 36: Building mobile apps using Phonegap

var db; //set a global variable

// create the db instance function createDB() { db = window.openDatabase( "myblog", "1.0", "Blog DB"); db.transaction(populateDB, errorCB, successCB); }

SAMPLE APPLICATION : STORAGE API

Page 37: Building mobile apps using Phonegap

var db; //set a global variable

function populateDB(tx) { // drop the Blog table if it exists tx.executeSql(’Blog TABLE IF EXISTS POSTS'); }

SAMPLE APPLICATION : STORAGE API

Page 38: Building mobile apps using Phonegap

tx.executeSql(’ CREATE TABLE IF NOT EXISTS POSTS (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, title varchar(255) NOT NULL, description TEXT)');

SAMPLE APPLICATION : STORAGE API

Page 39: Building mobile apps using Phonegap

tx.executeSql("INSERT INTO POSTS (title, description) VALUES (?, ?)", [title, post_desc]);

STORAGE API

Page 40: Building mobile apps using Phonegap

tx.executeSql("INSERT INTO POSTS(title, description) VALUES (?, ?)", [title, post_desc]); navigator.notification.alert("Title "+ title );

STORAGE API

Page 41: Building mobile apps using Phonegap

tx.executeSql('SELECT * FROM POSTS', [], querySuccess, errorCB);

function querySuccess(tx, results) {results.rows.item(i).title

STORAGE API

Page 42: Building mobile apps using Phonegap

PLUGİNS

• Facebook• Paypal• More….

Page 43: Building mobile apps using Phonegap

How to Deploy in Device

Change appName-info.plist file

Page 44: Building mobile apps using Phonegap

How to Deploy in Device

Change to iOS Device

Change version & Device

Page 45: Building mobile apps using Phonegap

How to Deploy in Device

Hit Run

Page 46: Building mobile apps using Phonegap

How to deploy in Device

Page 47: Building mobile apps using Phonegap

HOW TO DEPLOY IN DEVICE

Run as Android Application

Page 48: Building mobile apps using Phonegap

REFERENCE

http://docs.phonegap.com

Page 49: Building mobile apps using Phonegap

Thank You

Any Question?