georges chitiga - introduction to phonegap - html5 & js to native mobile app

Post on 09-May-2015

750 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

{

Native mobile apps with HTML, CSS & JavaScript

Georges Chitiga – CEO, CTO at VoDoo Solutions http://vodoosolutions.com

Build your app with:

Actually, almost everything that works with:

What is PhoneGAP ?

What is PhoneGAP ?

One code, deploy to all

JavaScript is cooler everyday

Better then web apps - iPhone 3GS+ - Android - Blackberry 5+ - WebOS - Windows Phone 7 - W8 Coming Soon - Symbian - Bada

What is PhoneGAP ?

One code, deploy to all

JavaScript is cooler everyday

Every day new frameworks, new cool techniques and new technologies rise.

Better then web apps - iPhone 3GS+ - Android - Blackberry 5+ - WebOS - Windows Phone 7 - W8 Coming Soon - Symbian - Bada

What is PhoneGAP ?

One code, deploy to all

JavaScript is cooler everyday

Every day new frameworks, new cool techniques and new technologies rise.

Better then web apps - iPhone 3GS+ - Android - Blackberry 5+ - WebOS - Windows Phone 7 - W8 Coming Soon - Symbian - Bada

PhoneGAP allows you to access the device SDK API

Code Upload Build Run

Did you understand ?

PhoneGAP API

PhoneGAP API

<!DOCTYPE html> <html> <head> <title>Application Title</title> <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>

PhoneGAP API

<script type="text/javascript" charset="utf-8"> var pictureSource; // picture source var destinationType; // sets the format of returned value // Wait for PhoneGap to connect with the device document.addEventListener(“deviceReady",onDeviceReady,false); // PhoneGap is ready to be used function onDeviceReady() { pictureSource=navigator.camera.PictureSourceType; destinationType=navigator.camera.DestinationType; }

PhoneGAP API

function capturePhoto() {

navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50 }); }

//HTML

<button onclick="capturePhoto();">Capture Photo</button>

PhoneGAP API

function capturePhotoEdit() { navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true }); }

PhoneGAP API

function onPhotoDataSuccess(imageData) { var smallImage = document.getElementById('smallImage'); smallImage.style.display = 'block';

smallImage.src = "data:image/jpeg;base64," + imageData; }

//HTML

<img style="display:none;width:60px;height:60px;" id="smallImage" src="" />

PhoneGAP API

Navigator.camera.getPicture Camera Options

quality : 75, destinationType : Camera.DestinationType.DATA_URL, sourceType : Camera.PictureSourceType.CAMERA, allowEdit : true, encodingType: Camera.EncodingType.JPEG, targetWidth: 100, targetHeight: 100

PhoneGAP API

http://docs.phonegap.com/en/2.2.0/

DEMO TIME

QA

Diamond Sponsors

Platinum Sponsors Gold Sponsors

Training Partners Media Partners Other Partners

top related