Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How PhoneGap really works
Search
Ilya Pukhalski
February 12, 2013
Programming
5
990
How PhoneGap really works
PhoneGap (PhoneGap API's, PhoneGap plugins, PhoneGap Build) from behind
Ilya Pukhalski
February 12, 2013
Tweet
Share
More Decks by Ilya Pukhalski
See All by Ilya Pukhalski
There's a bot for that
pukhalski
1
280
50 Shades of Flux
pukhalski
3
360
Why Mobile Web Still Sucks
pukhalski
3
500
Responsive Typography: Wrap-Up
pukhalski
8
380
Next Level SVG
pukhalski
1
1.5k
XFramework: the story so far
pukhalski
0
460
XFramework: build cross-platform responsive web apps easily
pukhalski
3
880
Mobile Cross-Platform Development
pukhalski
2
290
Rest in PS: рабочий процесс современного веб-дизайнера
pukhalski
12
1.5k
Other Decks in Programming
See All in Programming
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
160
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Realtime API 入門
riofujimon
0
150
cmp.Or に感動した
otakakot
2
130
Jakarta EE meets AI
ivargrimstad
0
530
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
CSC509 Lecture 11
javiergs
PRO
0
180
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
How to Ace a Technical Interview
jacobian
276
23k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
89
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Scaling GitHub
holman
458
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Building Your Own Lightsaber
phodgson
103
6.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
The Invisible Side of Design
smashingmag
298
50k
Code Reviewing Like a Champion
maltzj
520
39k
Music & Morning Musume
bryan
46
6.2k
Transcript
Ilya Pukhalski, EPAM SEC 2013 PHONEGAP How really works
@witchfinderx 2 Ilya Pukhalski, EPAM Mobile Competency Center
WHAT WILL WE DISCUSS? 3
— That mobile mobile world... — What is PhoneGap? -
A brief history of PhoneGap - How PhoneGap works - PhoneGap APIs - Plugins - Cons and limitations — PhoneGap Build — The future is closer than you think 4
THAT MOBILE MOBILE WORLD... 5
6 June, 2007
7 +
8 July 10, 2008
9 One of the main world problems today
Everything is WEB 10
11 What's in common?
12 All of them have a browser
PHONEGAP 13
PhoneGap is an open source framework that enables to build
cross-platform hybrid mobile applications using web technologies (HTML, CSS, JavaScript). 14
PhoneGap 2.3.0 15
HISTORY OF PHONEGAP 16
iPhoneDevCamp 2008 17 PhoneGap 1.0 2009 Migration to Apache Cordova
2012 IBM get involved into development late 2009 PhoneGap Build official launch late 2012
HOW PHONEGAP WORKS 18
19
20
21
22
None
24
25 PhoneGap Build Process
PHONEGAP API'S 26
27 — Accelerometer — Camera — Compass (excl. iPhone 3/3G,
BlackBerry OS 5+ and Symbian) — Contacts (excl. WebOS) — File (excl. WebOS, Symbian, Bada) — Geolocation — Media (excl. BlackBerry OS 5+, WebOS, Symbian, Bada) — Network — Notification — Storage (excl. Bada)
28
29 API call example `navigator' is a global namespace for
all API calls
HELLO WORLD 30
Including cordova.js
32 Adding listener on "deviceready"event
33 showAlert(); will display a native notification
34 Show notification as soon as device is ready
PLUGINS 35
36
37 HelloWorld.js
38 PhoneGap Bridge exec call
39 PhoneGap Bridge exec call Cordova.exec bridge CDV-HelloWorld.js
40 CLI for plugin boilerplate
41 CLI for plugin boilerplate
42 iOS native code #import <Cordova/CDVPlugin.h> @interface HelloWorld : CDVPlugin
@end #import "HelloWorld.h" @implementation HelloWorld @end HelloWorld.h HelloWorld.m Inheritance
43 Adding methods #import <Cordova/CDVPlugin.h> @interface HelloWorld : CDVPlugin -
(void)add:(CDVInvokedUrlCommand*)command; @end #import "HelloWorld.h" @implementation HelloWorld - (void)add:(CDVInvokedUrlCommand*)command { } @end HelloWorld.h HelloWorld.m Instance method Instance method
44 Retrieving arguments #import "HelloWorld.h" @implementation HelloWorld - (void)add:(CDVInvokedUrlCommand*)command {
double a = [[command.arguments objectAtIndex:0] doubleValue]; double b = [[command.arguments objectAtIndex:1] doubleValue]; double result = a + b; } @end HelloWorld.m Retrieve arguments; Addition.
45 Sending the result #import "HelloWorld.h" @implementation HelloWorld - (void)add:(CDVInvokedUrlCommand*)command
{ double a = [[command.arguments objectAtIndex:0] doubleValue]; double b = [[command.arguments objectAtIndex:1] doubleValue]; double result = a + b; CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:result]; [self writeJavascript: [pluginResult toSuccessCallbackString:command.callbackId]]; } @end HelloWorld.m Send result back
46 Adding plugin mapping to Cordova.plist
47 Calling our plugin from JS
CONS & LIMITATIONS 48
— Fast changing inconsistent API — Lacks and inaccuracies in
documentation — Some device specific API's are still unavailable for some OS — Dealing with cross-platform web development issues 49
PHONEGAP BUILD 50
51 PhoneGap Build is a cloud based service built on
the top of PhoneGap framework.
— PhoneGap Build is a cloud service — PhoneGap Build
API can help in establishing CI — No need to have different environment OS and SDK's to build an application 52 PhoneGap Build Pros
THE FUTURE IS CLOSER THAN YOU THINK 53
Some API's are already accessible 54
55 Device Specific API's accessibility: Accelerometer
Device Specific API's accessibility: File API (incl. camera uploads)
Average support is ~70%
58 https://vimeo.com/55486684 Sencha Fastbook
QUESTIONS? 59
@witchfinderx 60
@witchfinderx 60