forked from SLC-JS-Learners/phonegap-presentation
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
453 lines (392 loc) · 15.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PhoneGap</title>
<meta name="description" content="A presentation about PhoneGap for SLC JS Learners.">
<meta name="author" content="MetaSean">
<meta name="presentation framework" content="reveal.js">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/black.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section> <!-- installation -->
<section style="">
<div style="float:left;">
<h2>Prerequisites</h2>
<ul style="float:left;">
<li>PhoneGap via NPM</li>
<li>git</li>
<li>GitHub account</li>
<li>QR reader app <br />(recommended)</li>
</ul>
</div>
<div style="float:right;">
<h2>Wireless</h2>
<ol>
<li>octanner.com / 10.0.0.1</li>
<li>type in your email address</li>
<li>do NOT press enter; <br />click the submit button</li>
</ol>
</div>
<div style="clear: both;"></div>
</section>
<section>
<h2>Install PhoneGap with NPM</h2>
<pre><code>$ sudo npm install -g phonegap</code></pre>
</section>
<section>
<h2>Install NPM</h2>
<a href="http://nodejs.org/download/">http://nodejs.org/download/</a>
</section>
</section>
<section> <!-- title -->
<section>
<aside class="notes">
<ul>
<li>Sponser: O.C. Tanner Labs, provides space and dinner</li>
<li>At 7:30 we are followed by UtahJS SLC Meetup; led by Ken Snyder and Joe Eames</li>
<li>Other relevant meetups include:<ul>
<li>LunchJS</li>
<li>AngularJS Utah</li>
<li>ReactJS</li>
<li>primarily for women is the Girl Develop It Salt Lake City group</li>
<li>a new SLC Front-End Web Developers</li>
</ul></li>
</aside>
<h1>SLC JS Learners</h1>
<ul>
<li class="fragment">Sean Duncan</li>
<li class="fragment">O.C. Tanner Labs</li>
<li class="fragment">UtahJS SLC Meetup</li>
<li class="fragment">Other meetups</li>
</li>
</ul>
</section>
<section>
<aside class="notes">
<ul>
<li>Thank you to Anthony Martinez</li>
<li>Baseline knowledge expectation - Completed or actively working on completing <a href="http://www.codecademy.com/tracks/javascript">codecademy's JavaScript track</a></li>
<li>We don't want any highfalutin topics.</li>
<li>Hands-on - This isn't designed to be a spray and pray lecture.</li>
</ul>
</aside>
<h2>SLC JS Learners - Principles</h2>
<ul>
<li class="fragment">Knowledge level: <a href="http://www.codecademy.com/tracks/javascript">codecademy's JavaScript track</a>.</li>
<li class="fragment">If you have a question - ASK!!!</li>
<li class="fragment">Topics relevant to novices and junior devs.</li>
<li class="fragment">Hands-on</li>
</ul>
</section>
</section>
<section> <!-- title -->
<h3>An introduction to Adobe's</h3>
<h1>PhoneGap</h1>
<p>
By <a href="http://metasean.info/#/">MetaSean</a>
</p>
<hr />
<p>
<a href="https://github.com/SLC-JS-Learners/phonegap-presentation/index.html">github.com/SLC-JS-Learners<br/>/phonegap-presentation/index.html</a>
</p>
</section>
<section> <!-- history -->
<h2>History & Names</h2>
<ul>
<li class="fragment">PhoneGap was created around 2009 by Nitobi.</li>
<li class="fragment">In 2011, Adobe bought Nitobi and the PhoneGap brand.</li>
<li class="fragment">PhoneGap's source code was donated to the Apache Software Foundation.</li>
<li class="fragment">
<img src="./img/cordova-logo.jpg" style="vertical-align: middle; width: 43px; border: none"/>
Apache's open source code is called Cordova.
</li>
<li class="fragment">
<img src="./img/phonegap-logo.jpg" style="vertical-align: middle; border: none"/>
Adobe's PhoneGap extends Cordova.
</li>
</ul>
<p></p>
<small class="fragment">
<ul>
<p>Sources:</p>
<li><a href="http://ionicframework.com/blog/what-is-cordova-phonegap/">http://ionicframework.com/blog/what-is-cordova-phonegap/</a></li>
<li><a href="http://phonegap.com/2012/03/19/phonegap-cordova-and-what%E2%80%99s-in-a-name/">http://phonegap.com/2012/03/19/phonegap-cordova-and-what%E2%80%99s-in-a-name/</a></li>
<li><a href="https://en.wikipedia.org/wiki/PhoneGap">https://en.wikipedia.org/wiki/PhoneGap</a></li>
</ul>
</small>
</section>
<section>
<h2>Supported Cordova Platforms</h2>
<ul>
<li>Amazon Fire OS</li>
<li>Android</li>
<li>BlackBerry 10</li>
<li>Firefox OS</li>
<li>iOS</li>
<li>Ubuntu</li>
<li>Windows Phone 8</li>
<li>Windows</li>
<li>Tizen</li>
</ul>
</section>
<section>
<h2>Single Page Application (SPA)</h2>
<aside class="notes">
<a href="http://alpha.ideavis.co/529cc5f">http://alpha.ideavis.co/529cc5f</a>
</aside>
<ul>
<li>AngularJS</li>
<li>EmberJS</li>
<li>Backbone</li>
<li>Kendo UI</li>
<li>Monaca</li>
<li>ReactJS</li>
<li>Sencha Touch</li>
<li>jQuery Mobile</li>
<li>many, many, more</li>
</ul>
<p>
<small><a href="http://alpha.ideavis.co/529cc5f">http://alpha.ideavis.co/529cc5f</a></small>
</p>
</section>
<section>
<h2>App versus Command Line</h2>
<p class="fragment">PhoneGap Developer App<br />
<a href="http://app.phonegap.com/">app.phonegap.com/</a></p>
</section>
<section> <!-- starting project -->
<aside class="notes">
The "platform" at the end of the error messaged is an edge-case artifact of either WebStorm or the Reveal presentation template; it's not in the actual error message.
</aside>
<section>
<h2>Let's get codin'</h2>
<ol>
<li>Create and navigate to your project directory.</li>
<li class="fragment"><pre><code>$ phonegap create app-name</code></pre></li>
<li class="fragment"><pre><code>$ cd app-name</code></pre></li>
<li class="fragment"><pre><code>$ phonegap run android</code></pre></li>
</ol>
</section>
<section>
<h2>Build Error!!!</h2>
<pre><code>[phonegap] executing 'cordova run android'...
No platforms added to this project.
Please use `cordova platform add <platform>`.</code></pre>
</section>
</section>
<section> <!-- to GitHub -->
<h2>Push to GitHub</h2>
<ol>
<li>Create the new project in your GitHub account</li>
<li class="fragment"><pre><code>echo "# SLC JS Learner's phonegap-demo" >> README.md</code></pre></li>
<li class="fragment"><pre><code>$ git init</code></pre></li>
<li class="fragment"><pre><code>$ git add .</code></pre></li>
<li class="fragment"><pre><code>$ git commit -m "init commit"</code></pre></li>
<li class="fragment"><pre><code>$ git remote add origin [email protected]:SLC-JS-Learners/phonegap-demo.git</code></pre></li>
<li class="fragment"><pre><code>$ git push -u origin master</code></pre></li>
</ol>
</section>
<section> <!-- to PhoneGap builder -->
<h2>Push to Adobe PhoneGap </h2>
<ol>
<li class="fragment">Create an Adobe PhoneGap account at: <a href="https://build.phonegap.com/plans">build.phonegap.com/plans</a></li>
<li class="fragment">Paste your new GitHub repo into the *open-source* tab on <a href="https://build.phonegap.com/apps">build.phonegap.com/apps</a></li>
</ol>
<img class="fragment" src="img/git%20repo%20into%20build_phonegap_com_apps%20-%20highlighted.jpg" />
</section>
<section>
<h2>Build, baby, build</h2>
<img src="img/phonegap%20ready%20to%20build%20-%20highlighted.jpg" />
</section>
<section>
<h2>Download</h2>
<img src="img/qr%20code%20-%20highlighted.jpg" />
</section>
<section>
<section>
<h2>Update <code>index.html</code></h2>
<ul><li>Delete the following lines:
<pre><code><h1>PhoneGap</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
</div></code></pre></li>
<li>Replace with the following line:
<pre><code><h1>PhoneGap Demo</h1>
<p>Hello World</p></code></pre></li>
<li>Delete the following lines:
<pre><code><link rel="stylesheet" type="text/css" href="css/index.css" /></code></pre></li></ul>
</section>
</section>
<section>
<h2>Test Locally</h2>
<ul>
<li><pre><code>phonegap serve</code></pre></li>
<li>Open the 'listening on' address (e.g. <code>192.168.8.102:3000</code>)</li>
</ul>
</section>
<section> <!-- to GitHub -->
<h2>Push to GitHub</h2>
<pre><code>$ git add .
$ git commit -m "init commit"
$ git push -u origin master</code></pre></li>
</ol>
</section>
<section>
<h2>Edit <code>config.xml</code></h2>
<ul>
<li>Edit the following fields, as appropriate:
<ul>
<li>name</li>
<li>description</li>
<li>author email</li>
</ul></li>
<li>Reference:
<ul>
<li><a href="http://docs.phonegap.com/en/4.0.0/cordova_plugins_pluginapis.md.html#Plugin%20APIs">docs.phonegap.com/en/4.0.0/cordova_plugins_pluginapis.md.html#Plugin APIs</a></li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Review Plug-in API and other resources</h2>
<ul>
<li><a href="http://plugins.cordova.io/#/package/org.apache.cordova.camera">cordova.camera</a></li>
<li><a href="http://code.tutsplus.com/tutorials/phonegap-from-scratch-camera-api-app-exporting--mobile-9519">TutsPlus</a></li>
<li><a href="http://ventusmoso.com/phonegap/jquerymobile/phonegap-camera-tutoria/">jQuery</a></li>
</ul>
</section>
<section>
<h2>Create <code>camera.js</code></h2>
<pre><code>function capturePhoto(){
navigator.camera.getPicture(photoTaken, error,
{
sourceType: 1,
quality: 60
});
}
function photoTaken(data) {
cameraPic.src = data;
alert('Photo taken: ' + cameraPic.src);
}
function error(msg) {
alert('Error: ' + msg);
}</code></pre>
</section>
<section>
<h2>Update index.html</h2>
<ul>
<li>Delete:<br />
<pre><code><p>Hello World</p></code></pre>
Replace with:<br />
<pre><code><button class="camera-control" onclick="capturePhoto();">Capture Photo</button>
<div style="text-align:center;margin:20px;">
<img id="cameraPic" src="" style="width:auto;height:120px;"></img>
</div></code></pre></li>
<li><em>After</em> the line:
<pre><code><script type="text/javascript" src="js/index.js"></script></code></pre>
Add:
<pre><code><script type="text/javascript" src="js/camera.js"></script></code></pre></li>
</ul>
<pre><code></code></pre>
</section>
<section>
<section>
<h2>Push and rebuild</h2>
<ul>
<li><pre><code>$ git add .
$ git commit -m "init commit"
$ git push -u origin master </code></pre></li>
</ol></li>
<li>
<img src="img/update%20code%20-%20highlighted.jpg" style="vertical-align: top;"/>
</li>
</ul>
</section>
<section>
<h2>No need to Rebuild</h2>
<img src="img/rebuild%20-%20highlighted.jpg" />
</section>
<section>
<h2>Download and Reinstall</h2>
<img src="img/qr%20code%20-%20highlighted.jpg" />
</section>
</section>
<section>
<aside class="notes">
In my initial tests, there are some modifications required to get an Ionic app to compile correctly.
</aside>
<h2>Areas for Improvement & Exploration</h2>
<ul>
<li>Make the design responsive (e.g. webkit)</li>
<li>Make camera fully independent<br />
(i.e. no need to route through another app)</li>
<li>What benefit does the "Developer App" provide?</li>
<li>What is "hydration"?</li>
<li>How does it work with Ionic apps?</li>
</ul>
</section>
<section>
<aside class="notes">
Both tutorials are for PhoneGap version <strong><em>3.x.x</em></strong>. According to `phonegap -v`, the version I downloaded this weekend is <strong><em>4.2.0-0.23.0</em></strong> .
</aside>
<h2>More Tutorials</h2>
<ul>
<li>Basic - Zombie To-Do list: <a href="http://www.raywenderlich.com/30734/phonegap-tutorial-a-cross-platform-zombie-app">http://www.raywenderlich.com/30734/phonegap-tutorial-a-cross-platform-zombie-app</a></li>
<li>Advanced - Mobile API Hodgepodge: <a href="http://coenraets.org/blog/phonegap-tutorial/">http://coenraets.org/blog/phonegap-tutorial/</a></li>
</ul>
</section>
<section style="text-align: left;"> <!-- ending -->
<h1>THE END</h1>
<ul>
<li>This presentation is available at <a href="https://github.com/SLC-JS-Learners/phonegap-presentation">github.com/SLC-JS-Learners/phonegap-presentation</a></li>
<li>Presentation uses the <a href="http://lab.hakim.se/reveal-js/#/">Reveal</a> presentation framework by <a href="http://hakim.se">Hakim El Hattab</a> / <a href="http://twitter.com/hakimel">@hakimel</a></li>
</ul>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>