Bummer! This is just a preview. You need to be signed in with a Pro account to view the entire video.
Start a free Basic trial
to watch this video
Build Fast and Beautiful Native Apps with Web Tech Using PhoneGap and TopCoat
56:47 with Brian LeRouxEveryone knows you can build an app for many platforms using HTML, CSS, and JavaScript but the jury has been out as to whether you can build a beautiful, responsive, lighting fast app. Complete with disaster defying demos and legit hand coding, Brian will guide you through the history, direction, and HOW to build an app using web tech for iOS, Android and other platforms.
-
0:00
[BLANK_AUDIO].
-
0:05
Do we have any PhoneGap developers in the room?
-
0:07
Oh, shit, that's awesome.
-
0:11
There used to be zero, so, I'm stoked about that.
-
0:14
All right, so let's dig in.
-
0:17
The, thing I hate the most about software conferences, is that you'll
-
0:21
have someone come here and they will talk to you for an hour.
-
0:23
And they won't show you a single line of code.
-
0:26
I'm not gonna do that.
-
0:26
I'm gonna try and show you guys, like how
-
0:28
this stuff works and so, let's build an app.
-
0:33
Anybody here building apps?
-
0:37
Right on.
-
0:38
Native apps, like iOS?
-
0:40
Android?
-
0:42
Okay, Firefox OS?
-
0:48
Nothing?
-
0:49
It's sweet, dude.
-
0:50
You should check it out.
-
0:51
Okay so I, I work on the PhoneGap project.
-
0:55
We've got a bunch of toys to play with today.
-
0:58
I just bumped my phone a little bit.
-
1:01
So, PhoneGap is at the moment a command line utility.
-
1:06
That you download and install.
-
1:08
It's a node module, and so if I, if I need it, I need to have node.
-
1:11
And then to install it I just do MPMI G PhoneGap, and I'd get it.
-
1:15
That would download the Internet and eventually install PhoneGap.
-
1:19
And then I can run it, on the command line by typing in PhoneGap.
-
1:25
This in itself is not all that exciting.
-
1:28
The command line isn't all that scary either.
-
1:30
Something that's interesting about PhoneGap once you run it once
-
1:33
it's gonna give you this little grid as a helper.
-
1:38
So you know which platforms you can build for.
-
1:40
On your current situation.
-
1:42
And you'll see, it's like local, environment and remote environment.
-
1:46
If you want, you can configure PhoneGap to work remotely.
-
1:48
I'm not gonna do that.
-
1:50
And then it gives you like all the
-
1:52
various, you know, commands that you can run.
-
1:54
So, cuz I'm lazy and hung over, I'm gonna do PhoneGap create, Foobaz.
-
2:05
And would I create a project called FooBaz.
-
2:07
So we're gonna jump into FooBaz, and we're gonna take a look at, I use Bem.
-
2:12
I'm old, you don't have to, it's not a prerequisite to doing this stuff.
-
2:16
I think Bem's useful, You know, pick your
-
2:19
text editor of choice, it doesn't really matter.
-
2:21
PhoneGap.
-
2:21
Super does not care.
-
2:22
This is just web development.
-
2:23
And so, one of the, big things that we wanna first
-
2:27
take note of is a PhoneGap project has a www folder.
-
2:30
Very much like Apache, this is where your web assets go, so
-
2:34
you can put HTML, CSS, JavaScript in here to your heart's desire.
-
2:39
We've got a couple of other folders, I'm gonna get into those later.
-
2:42
You don't have to look at them right now and in fact none of these are mandatory.
-
2:45
This is the only one that counts and so if you, walk away
-
2:48
from this situation knowing anything you know we can deal with web stuff.
-
2:53
So, let's take a look at this.
-
2:56
We're an Apache software project.
-
2:57
I'll talk more about that in a bit.
-
2:59
Right now I'm just gonna totally fodge a license.
-
3:02
I'm gonna get rid of this because I don't care about iOS7.
-
3:05
And let's take a look at like what we got here.
-
3:07
So we've got some really basic markup, you
-
3:09
know, typical title, we've got these two, Paragraph elements.
-
3:16
One says, connecting device.
-
3:17
The other says, device is ready.
-
3:18
You'll have to take my word for it but the CSS in this
-
3:23
will, blank out device is ready until the device itself is actually ready.
-
3:29
We've got some hyper enthusiastic JavaScript developer in
-
3:31
here who decided that they would add this type.
-
3:34
I just wanna let you know that that is no longer necessary.
-
3:38
And, it's HTML5.
-
3:41
So I don't give a fuck about these quotes.
-
3:45
They can go away.
-
3:47
I totally just ruined everything.
-
3:52
Okay.
-
3:52
[SOUND] So now I can go PhoneGap Run iOS.
-
4:00
[LAUGH] Really?
-
4:07
[SOUND] I think I had a
-
4:12
demo project there.
-
4:18
So now I'm gonna jump into, under the hood into Xcode, do a bunch of crazy stuff,
-
4:23
in a compiler application and then we're gonna
-
4:26
launch it and we're gonna see the device's ready.
-
4:31
So, I type two commands, I'm on, iOS, that's kind of neat.
-
4:38
Everyone's like is Brian full of shit or not.
-
4:41
Let's just, go take a look back at that code.
-
4:47
I think I was editing, a sub project at that time.
-
4:51
So let's just change this to [SOUND]
-
4:57
says device it's ready, let's go like,
-
5:03
[SOUND] I have a Vegas level hangover.
-
5:08
All right.
-
5:15
[SOUND] Same business, kicks out the Xcode.
-
5:18
Under the hood.
-
5:20
We're trying to install our own device.
-
5:21
No device exists.
-
5:22
So then we find that we've got a simulator.
-
5:25
We launch it and I have a Vegas level hangover.
-
5:30
Cool.
-
5:31
That's interesting.
-
5:32
We're not quite living up to the promise of PhoneGap at this point.
-
5:36
So, I'm gonna plug in my phone.
-
5:40
Which is a Nexus 5.
-
5:46
[SOUND] and,
-
5:52
[SOUND] oh, no.
-
6:00
That's super uncool if you don't work.
-
6:02
[LAUGH] I
-
6:06
swear to God the phones plugged in.
-
6:09
Why Android why?
-
6:10
It's like it can detect when I'm presenting.
-
6:15
it's like I'm gonna screw with you.
-
6:18
Okay.
-
6:20
Does anyone have a, a mini USB cable, on them, by any chance?
-
6:26
This has to be the cable.
-
6:27
[BLANK_AUDIO].
-
6:33
You're a good man, I owe you a beer.
-
6:37
To your peril.
-
6:38
[LAUGH] All right, let's see if this works.
-
6:47
If this doesn't work, I even.
-
6:51
Oh, it did.
-
6:52
It was the cable.
-
6:53
That's super crazy.
-
6:54
Okay, so we'll, launch Photo Booth.
-
6:57
So you know I'm not a liar, I'm gonna go back
-
7:02
to my command line, and we'll do PhoneGap > Run Android.
-
7:06
[SOUND] And so, PhoneGap's gonna detect that I've got an Android device here.
-
7:13
It's gonna compile.
-
7:14
It's gonna dump a bunch of Java bullshit to my terminal.
-
7:18
Once that's done, [SOUND] it's gonna try and install it on the device.
-
7:24
Hm.
-
7:29
And
-
7:36
so, we're on.
-
7:38
Two platforms now with a grand total of three commands.
-
7:41
[SOUND] So there you go, there's your Hello World.
-
7:45
That's kinda how it works when you're
-
7:47
looking to build for multiple platforms with PhoneGap.
-
7:52
I'm
-
7:55
Aging, open source software developer.
-
7:57
And one of the things when.
-
7:59
So, open source is sorta like adopting kittens.
-
8:03
They're beautiful and you love them at first.
-
8:05
And then you own a cat.
-
8:05
And so [LAUGH].
-
8:09
It's the same thing.
-
8:10
I mean when you're, when you're adopting a technology
-
8:12
eventually you're gonna have to deal with it right.
-
8:14
And so, in order to understand whether or not
-
8:16
you think this technology is appropriate for your business,
-
8:20
your business drivers, you have to understand where it
-
8:22
came from and you have to understand where it's going.
-
8:25
Everybody jumped on, the rails bandwagon and they were super stoked.
-
8:29
Rails was great.
-
8:30
And then Rails went through a lot of change over time.
-
8:34
So understand where open source comes from helps you understand where it's going.
-
8:41
PhoneGap just like every other open source project
-
8:43
has a lot of weird mythology surrounding it.
-
8:46
So, I wanna clear some of that up.
-
8:48
In 2008.
-
8:50
Oh, actually it started in 2007, so in
-
8:51
2007 I used to work at this software company
-
8:53
in Vancouver called Nitobi, and we did a
-
8:56
lot of Blackberry development because we're Canadian, I guess.
-
9:00
I don't know why and we, we were really stoked
-
9:04
like the, the early I think it was called the Curve.
-
9:08
It was the first device with a GPS.
-
9:10
And we're like, this is, this is gonna be something.
-
9:12
This mobile thing.
-
9:13
And then Steve Jobs comes out and he walks on the stage, and
-
9:16
he holds up the iPhone, and he says you're gonna build web apps.
-
9:19
And we squealed like little girls, and we jumped in our cars, and we
-
9:22
drove down to Seattle because they didn't sell them in Canada at the time.
-
9:25
And we bought a shitload of iPhones, and we started building apps.
-
9:29
We love that model, that was, that was the right model,
-
9:32
Apple was like, you're going to build apps, we're like yes!
-
9:34
Exactly that, one year later, he's like sike!
-
9:38
You're building objective C apps.
-
9:40
We're like, oh, okay.
-
9:42
[LAUGH] And we checked it out, objective C is actually a pretty cool language.
-
9:47
I totally recommend learning it by the way, I'm not gonna tell you that you
-
9:50
shouldn't learn a new software language or
-
9:53
how to program a particular platform, you absolute.
-
9:56
Should be a better programmer, and you need to learn multiple languages.
-
10:00
That said, objective C is horrific.
-
10:02
So.
-
10:02
[LAUGH] We jumped in and we're like, okay, you know, there's probably some merit
-
10:08
to this ancient language, with, array syntax for accessing properties.
-
10:13
Maybe, maybe it can be useful.
-
10:15
And then we discovered that it's, it's got a web view.
-
10:17
And we were like oh, okay, well that's interesting,
-
10:19
so we can substantiate a web view, but can
-
10:21
we create some kind of like, binding where we
-
10:23
can call, you know, the JavaScript code from native?
-
10:27
And it turns out you super can.
-
10:29
With terribly named syntax, it's like execute string by evaluating string,
-
10:36
you can call in, but can you call back the other way?
-
10:39
And, it turns out that this just wasn't a supported
-
10:42
thing, at all, and a couple of our dudes went
-
10:45
down to, ironically, Adobe at the time, and they went
-
10:49
to this thing called iPhone dev camp and they're like.
-
10:51
They met some app developers and, hey, can
-
10:54
we call from the JavaScrip to the native site.
-
10:56
And this Apple developers are like, nope, not possible.
-
10:59
Well, I mean, you could pull the URL, that'll be crazy.
-
11:02
So, that's what they did.
-
11:04
So, PhoneGap ultimately creates it's bridge between
-
11:08
native code, and the web view that you're
-
11:10
sitting in, and then we do it in very of different ways for every single platform.
-
11:12
But, the original way we did it, and we don't do this any more, but you.
-
11:16
Could still do this if you wanted to.
-
11:18
Was polling on what the URL.
-
11:20
So we pass a message in the URL and we then set that protocol
-
11:23
handler and we'd be like, oh, okay, I'm actually looking for a native call.
-
11:26
And we'd execute some native code.
-
11:27
And then we could call into the JavaScript the other way.
-
11:31
Now everyone's thinking, oh my God that must be super slow, and you're right.
-
11:35
We only get about 400 hertz which would be
-
11:37
400 operations a second on that particular type of call.
-
11:41
Slow but I ask you do you need to get your geolocation 400 times a second?
-
11:49
Probably not.
-
11:50
So [LAUGH] it's really good for doing a lot of stuff.
-
11:53
Not everything.
-
11:54
So in 2008 we figured this out Rob and Barack, guys I used to
-
11:58
work with, and they had an iPhone and they had Super Mario on it.
-
12:03
And they would, tilt around this phone.
-
12:05
That big thick old first version iPhone, and
-
12:08
he would, Mario would react to the accelerometer.
-
12:11
At the time there was no device motion API.
-
12:13
This was, this was a big deal.
-
12:14
We're like, oh my God we figured out how to do this.
-
12:17
And then we didn't care.
-
12:18
We, went to the bar and got drunk like good Canadian kids do.
-
12:22
Dave Johnson, one of the guys that we work with,
-
12:24
was like hey wait guys I can do it with Blackberry.
-
12:27
Still, no one cared.
-
12:28
And then [LAUGH] another dude that we work with, Joe Bowser,
-
12:32
and do you remember that old, that first generation Android, that big
-
12:36
brick phone, the thing with the keyboard that made like a
-
12:39
fucking sound when you were, like, dealing with credit cards, like [SOUND]?
-
12:43
So he had that, and he's like, hey guys,
-
12:45
check it out, this is Android, this is the future.
-
12:47
And we're like [LAUGH] yeah, right, that's bullshit,
-
12:50
that thing's a piece of shit, there's no way.
-
12:53
So we were wrong about that.
-
12:54
But [LAUGH] he got, PhoneGap working on that.
-
12:58
And then we realized, we're like, oh my God, actually, wait a second.
-
13:03
We've got something that could be cross-platform.
-
13:05
So we threw it on GitHub and it really didn't matter.
-
13:08
Thousands and thousands of people started using it, and it still didn't matter.
-
13:12
No one cared.
-
13:12
It was kind of just a thing, it was a hack project.
-
13:15
And suddenly Apple started rejecting PhoneGap applications from the app
-
13:18
store, which was the best thing ever to happen to us.
-
13:21
[SOUND] We didn't care.
-
13:22
We thought, whatever.
-
13:24
We were building apps, and we liked them.
-
13:26
And they got into the app store sometimes.
-
13:28
And all of a sudden, boom, we're getting rejected.
-
13:31
And we had no idea why.
-
13:33
And we actually we're, like, well, you know?
-
13:35
Maybe this was like, dodgy on the acceptance rules or whatever.
-
13:38
So, it turns out [LAUGH] so the ReadWriteWeb
-
13:42
did an article, and they're like, PhoneGap being rejected!
-
13:45
Apple hates the web!
-
13:46
[LAUGH] And the internet like, rallied,
-
13:48
and they're like, help those PhoneGap guys!
-
13:51
None of this was true.
-
13:52
So what actually happened was, when you used to
-
13:55
create a PhoneGap project, it would name it PhoneGap.
-
13:59
Which made sense for us at the time.
-
14:00
And so Apple is getting thousands of apps submitted
-
14:03
to them called PhoneGap and they thought we were spammers.
-
14:05
So when they, when this article blew up and we finally talked
-
14:09
to them, they're like, oh, well can you just call it like, untitled?
-
14:12
And we're like yeah, we could do that.
-
14:15
And so, since PhoneGap in 0.8 in 2009.
-
14:19
We've been okay with Apple.
-
14:20
That's actually what kind of probably launched us.
-
14:24
In 2010 we were at OSCON cuz it's in Portland which is super close
-
14:29
to Vancouver and we would go there just cuz Portland's awesome.
-
14:34
They've got good craft beer and single origin coffee.
-
14:37
But we'd also go fo the open source stuff.
-
14:39
And we were hanging out with IBM guys.
-
14:41
And they're, like, hey, we're gonna throw a big team on PhoneGap.
-
14:43
And we're like, why [LAUGH] would you do that?
-
14:48
We had no idea what was going on.
-
14:50
They were like, no, no, no.
-
14:50
We think this is a legit project, and we wanna contribute to it.
-
14:53
And they started to teach us a lot about how open source probably should work.
-
14:56
Not how we thought it worked.
-
14:58
At that same time I started to you use PhoneGap as a vehicle to get
-
15:02
myself to travel to different places like Las
-
15:04
Vegas and [LAUGH] I ended up in Amsterdam.
-
15:08
And I was at a coffee shop and, we had
-
15:11
done a long day of training with all these different people.
-
15:16
And, basically, a PhoneGap training means that I have to teach you how, the
-
15:20
iOS SDK works, how the Android SDK works, how the Windows Phone SDK works.
-
15:25
And we're gonna install all that junk, and then we're gonna install Node.
-
15:28
And then hopefully, if we've got that Rube Goldberg machine
-
15:31
of things working, you're gonna be able to compile an app.
-
15:33
But it's a huge starting process.
-
15:35
So, literally [LAUGH] at a coffee shop while
-
15:38
I'm hanging out, I coded up a thing that,
-
15:41
we now call PhoneGap Build, which is a hosted
-
15:44
service where you can upload HTML, CSS and JavaScript.
-
15:49
Either a zip file or give us a Git repo and we'll compile
-
15:52
an app for you and give you a QR code to install it.
-
15:57
So, I wrote that, and we thought that was kind of funny and awesome.
-
16:03
Now we didn't need to install a bunch of SDKs, all you
-
16:05
needed was a, machine that was interconnected and you could build apps.
-
16:10
And we had like 80,000 sign ups in the first month,
-
16:12
so it went, it went pretty viral and people were stoked.
-
16:16
In 2011, we hit 1.0.
-
16:19
We finally started to find, kind of, our stride, and we were acquired by Adobe.
-
16:24
At that time, PhoneGap had what's called a CLA or a contributor license agreement.
-
16:30
CLA, it's open to debate if this thing matters or not.
-
16:35
Generally what it is, it's a license agreement where you say that the
-
16:39
outbound license, the license that everyone uses
-
16:41
your code, is the same as the
-
16:43
inbound license so you as the creator of some code, you then copyright that,
-
16:47
you would assign that copyright to, the
-
16:50
project that you're, you are contributing to.
-
16:52
So we had a CLA and that's a really normal thing to have in open source.
-
16:56
Most, probably almost all open source projects
-
16:59
have it, short of the Linux Kernel.
-
17:01
So, we had a CLA, but, it named named a
-
17:04
company called Nitobi Software, which just got acquired by Adobe.
-
17:09
And suddenly a lot of other companies that were contributing to
-
17:12
PhoneGap, including IBM, were like oh well so, I'm completely cool
-
17:16
you know, assigning my copyright and IP over to a small
-
17:20
company called Nitobi, totally not cool doing that to Adobe, weird.
-
17:26
So, [LAUGH] we decided at that time the best thing we could do
-
17:30
was to donate the source code of PhoneGap back to the Apache Software Foundation.
-
17:36
And I'm gonna talk a lot more about that.
-
17:39
Apache's a huge project and so in 2012 We started working
-
17:45
at Adobe full time on PhoneGap and it, it got a lot of adoption after that.
-
17:51
2013 I say optionally opinionated because we started
-
17:55
to carve PhoneGap up into two different pieces.
-
17:59
So there's the Apache Cordova project and then there's PhoneGap.
-
18:03
So PhoneGap is the thing I'm talking
-
18:05
about, it's a, thing for creating native apps.
-
18:08
Apache Cordova is the guts of that, it's the open source project.
-
18:12
Now, the difference between these two things
-
18:13
is actually nothing, they're the same thing.
-
18:17
Why is there something like that?
-
18:18
Well it's the same as like WebKit versus Safari or Linux versus Red Hat.
-
18:24
It's a downstream distribution.
-
18:28
I'm gonna, I'm gonna hold off on telling you what happens next.
-
18:31
Okay so, what, what is actually the difference between these two things.
-
18:35
So PhoneGap CLI, the thing showed you earlier
-
18:37
to build apps, has a remote build capability.
-
18:41
And that remote build capability hooks into.
-
18:44
PhoneGap build.
-
18:46
This thing here, so.
-
18:47
[SOUND] I can get
-
18:52
PhoneGap remote
-
18:58
build, iOS.
-
19:03
If I didn't have the iOS SDK installed.
-
19:07
It would default back to this.
-
19:10
[LAUGH] Oh, no.
-
19:12
Terrible demo.
-
19:13
Do I have connectivity?
-
19:18
[SOUND] PhoneGap
-
19:23
remote, run Android.
-
19:30
[SOUND] Cool, okay.
-
19:32
So, I'm not sure what I did wrong there.
-
19:38
More of the story being you can build, for
-
19:42
what ever platform on what ever computer your on.
-
19:45
So if your on a netbook.
-
19:46
You know, on a potentially, better connection than I have here.
-
19:52
[LAUGH] You'll be able to, build for iOS say, from a Windows machine.
-
19:59
That's kinda the point and this is our fun parlor trick.
-
20:05
Possibly the only cool use of a QR code ever is to dump that into your terminal,
-
20:11
using Antsy also.
-
20:16
It took us, like, months to do properly.
-
20:18
[LAUGH].
-
20:19
We super didn't care because we're like, this is rad.
-
20:24
>> So Apache Cordova.
-
20:25
>> Apache Cordova is phone gap that is the same thing.
-
20:29
>> And Apache Cordova is a little bit different and interesting.
-
20:34
>> So, let me show it to you.
-
20:39
>> I showed you a phonegap.
-
20:41
>> And all I had to was run phone gap on the command line and I got you know?
-
20:47
The sort of output where I can do stuff.
-
20:49
That's cool.
-
20:50
Cordova.
-
20:55
Really?
-
20:58
Well, we get to see the whole experience then, I guess.
-
21:01
Oh.
-
21:01
I'm going to install Cordova.
-
21:05
Totally to plan.
-
21:11
So NPM is the package manager for OJS.
-
21:15
Right now I'm downloading in the internet and possibly installing Cordova.
-
21:19
And at the bottom here we're linking into an
-
21:23
executable that's globally available which was that -G flag.
-
21:29
Cool.
-
21:30
So if I run Cordova, I get this output which is kinda nasty and big and weird.
-
21:35
Cordova's really low level.
-
21:38
Cordova is what we compose phone gap out of.
-
21:40
That's how we build phone gap.
-
21:42
You don't have to ever use Cordova if
-
21:44
you're not interested in it, it's just a tool.
-
21:47
So I can do Cordova create fubar.
-
21:54
And the first time I do this, it's going to have to download.
-
21:58
The platforms that I'm building for.
-
22:02
Cordova's lower level and so everything is kind of composable and you
-
22:05
can cut and paste little bits and pieces of it, treat everything differently.
-
22:10
So,
-
22:14
oh, fubar.
-
22:16
So again, totally the same thing, I've got an index.html, a www folder.
-
22:25
I have got these completely unnecessary type declarations.
-
22:31
So I am gonna go at HTML5 and kill that.
-
22:35
I hate that.
-
22:36
I don't know why.
-
22:37
But if I do, like, Cordova run ios, it's gonna yell at me.
-
22:42
It's gonna be like, oh, you can't do that.
-
22:44
So Cordova doesn't have any knowledge or try and help you.
-
22:49
Again it's low level and you can pose apps
-
22:51
out of it so I have to do Cordova platform.
-
22:54
Add IOS Android Firefox OS, whatever.
-
22:59
And it's gonna install and create those projects for me.
-
23:01
And in case of phone gap it just does that stuff automatically.
-
23:05
So these are the subtle differences between the two.
-
23:07
A lot of people build on top of Cordova and we didn't really
-
23:10
wanna like lock Cordova into a particular work flow because it's an upstream.
-
23:16
It's kinda like a gnarly, composable situation.
-
23:20
Now you as a developer, you may want to utilize that, though.
-
23:25
So earlier I glossed over this but there's this www
-
23:29
folder and we've got index.html in there and some assets.
-
23:33
We also have this platforms folder.
-
23:35
So inside of platforms you noticed earlier that I added Android Firefox OS in an IOS.
-
23:41
Each of these is a native project to that platform.
-
23:45
And this is sorta one of the others misconceptions about
-
23:49
PhoneGap people are like, oh, PhoneGap projects they are not native.
-
23:53
Yeah, they super are.
-
23:54
That's how we do it, that's how it actually works.
-
23:57
So this is a native Android project with native code and everything.
-
24:02
You can instrument if you would be so interested in doing that.
-
24:07
This is a part of your project we don't dictate whether or not you
-
24:12
wanna get in there and do native
-
24:13
development but it's your option to do that.
-
24:16
And that's how it works.
-
24:18
So I added those platforms whatever and then I can do like cord overrun IOS.
-
24:24
For example, and very much like phone gap,
-
24:26
it's gonna run that command for me eventually, probably.
-
24:30
Dump a bunch of ex-code garbage out to my terminal.
-
24:33
Try and find a simulator, didn't find one, some ugly guy,
-
24:41
not my company, slack.
-
24:43
There we go.
-
24:43
So, Cordova, different branding, same gig, if that makes sense.
-
24:53
So Cordova's at the Apache Software Foundation.
-
24:57
Apache is this non-for-profit open source foundation where code can live happily in
-
25:04
a neutral territory free of legal woe from other companies or any company, really.
-
25:10
Apache owns the trademark to Cordova.
-
25:12
That means that all the source code of Cordova is free and will remain free.
-
25:16
That's kind of important.
-
25:18
Apache came from the Apache web server, so it's got good web roots.
-
25:22
Apache claims that individuals compose the ASF.
-
25:25
I am inclined to believe this because you have to sign
-
25:28
an individual contributor license agreement or
-
25:31
the contribute code back to Apache.
-
25:33
However truthfully, a lot of organizations work with Apache.
-
25:37
So, the ASF, as we like to call it has a lot of
-
25:40
different principles and these principles are sort
-
25:42
of interesting and we are talking about.
-
25:44
The ASF believes in collaborative software development.
-
25:47
We believe in a commercially friendly license.
-
25:49
This is hugely important and different than most other free software foundations.
-
25:56
We believe in high quality software and we
-
25:58
try and get there by having continuous integration.
-
26:00
We believe in respectful, technical, honest based interaction.
-
26:04
At least that's what we say on this slide.
-
26:06
And we believe in a faithful implementation standards.
-
26:08
This was one of the reasons that we ended up at Apache.
-
26:11
The Apache web server was obviously instrumental
-
26:14
in the net as we see it today.
-
26:15
And phone gap in Cordova had an initial goal of ceasing to exist.
-
26:20
Sounds contrary and weird.
-
26:21
Why would we want that?
-
26:22
Well actually we don't want to build native apps.
-
26:24
We don't wanna dive into proprietary traps.
-
26:27
We really want is to build web apps.
-
26:30
Unfortunately, mobile isn't going that way and
-
26:33
so that's why there's something called phone gap,.
-
26:36
And ultimately, the reason we chose the Apache Software Foundations is
-
26:39
because it was a web believer, security is a mandatory feature.
-
26:45
And that comes back to how we do things.
-
26:47
Apache has all these sorta arcane and weird
-
26:50
rules about incubation and is actually, like, a
-
26:52
22-year-old organization believe it or not and so
-
26:54
open source has been happening for a long time.
-
26:57
To get into Apache is one thing and then to actually
-
26:59
become called a Top Level Project is another thing all together.
-
27:02
So when we first joined Apache we had to
-
27:05
go through an incubation process, which thankfully we survived.
-
27:09
So earlier I said individuals compose the ASF and that's totally true
-
27:14
but actually a lot of organizations sponsor software development at the ASF.
-
27:18
And the big reason for that is
-
27:19
the Apache software license is very commercially friendly.
-
27:22
And so all these company's can collaborate and donate code back to the
-
27:27
Apache software foundation ultimately Cordova without
-
27:30
any kind of legal ambiguity around patenting.
-
27:33
And so we've got Adobe, BlackBerry, Google, Microsoft,
-
27:39
IBM, Intel, Mozilla, and believe it or not LG, all working towards this end.
-
27:46
Which is great.
-
27:48
I think there's 67 sponsored full-time developers now
-
27:51
working on the thing called phone gap, ultimately Cordova.
-
27:57
So we used to have this sort of bad habit where we were shipping a lot of software
-
28:01
all the time but we weren't versioning it, we
-
28:03
weren't doing proper releases really and that was okay.
-
28:09
And it went on for a long time.
-
28:11
We actually sat on 0.8 for, I shit you not, almost a year and a half.
-
28:15
And so people would file bugs and we'd be like, oh it's weird, it works for me.
-
28:19
What version?
-
28:20
Oh, right, you're on the same version I am.
-
28:23
And so versioning we realized was actually just creating a window for bugs.
-
28:28
And so we adopted some people call this rolling releases or some I don't really
-
28:36
it, but some people call it like the agile release train, I just hate the word agile.
-
28:40
It sounds really like I'm trying to sell you something, but I'm not.
-
28:43
So, I like to call it the heartbeat of the cadence and
-
28:46
by the way, these slides are all online and this is a link.
-
28:49
Or I did a long probably kind of boring blog post about
-
28:56
why we ship software the way we ship it, a few years back.
-
29:01
Effectively, we try and ship it every month.
-
29:03
And so, we close the window on where the bugs could possibly be.
-
29:07
Sometimes, people don't love this.
-
29:08
So they go, you guys ship too much.
-
29:10
Like, I have actually heard that.
-
29:12
Shipping is the actually the only goal that open source project.
-
29:15
And by closing that window for bugs that means
-
29:17
that we can get consistently higher quality software releases.
-
29:22
If you're in one of those projects, where you're shipping once a year.
-
29:26
You've just created a one year window of bugs.
-
29:28
That's totally not actually helping your ultimate goal of
-
29:32
getting out there and having consistently high quality software.
-
29:35
Shipping more often is a good thing.
-
29:39
We've got rules about how to contribute effectively.
-
29:41
We're a GitHub project.
-
29:43
I'm gonna show this to you just for morbid curiosity.
-
29:46
If we go to github.com/apache.
-
29:48
You're gonna see that there's a buttload of Apache projects.
-
29:55
But if I filter in on Cordova you can see that we've got a lot of reposts.
-
30:02
I think we're at something like 50 or more reposts of good software so.
-
30:14
How do you contribute.
-
30:14
Well, you use GitHub basically.
-
30:17
Contributing's different than committing.
-
30:19
So commit rights are when you can
-
30:22
contribute without basically someone else merging that commit.
-
30:25
To become a committer is an honor in an open source project.
-
30:30
And it's not very hard and so, some projects have a high
-
30:33
bar of entry and we didn't really see the point in that.
-
30:36
You could have certain projects where you have to have multi-years of contributing
-
30:41
before you can become a committer and get commit rates and get that trust.
-
30:44
We sort of figured this whole internet thing's got legs and you
-
30:48
know, there's an audit trail built in, so we don't really care.
-
30:51
If you land a single commit we will
-
30:54
eventually give you commit rights to the entire project.
-
30:58
What that means is, you get a shiny Apache
-
31:00
e-mail address and then you can just write code.
-
31:02
And lowering up our entry is actually just enabled us
-
31:05
just to move even faster and we've got a bunch of
-
31:08
rules about how that works, so Apache's is cool because once
-
31:11
you get a commit rights at Apache you don't even need
-
31:14
commit rights then you become a part of bigger family and
-
31:17
there is a whole lot interesting projects at work in Apache
-
31:21
not just phone gap there's couch TO, Dupe, OpenOffice and many
-
31:24
many more including the web server so once you get involved
-
31:28
in this sort of open source community.
-
31:31
You really open up your opportunities as a software developer.
-
31:34
You can learn a lot of different stuff and you
-
31:36
can contribute back to the commons which is kind of cool.
-
31:39
Probably not a surprise, we really do love Apache and
-
31:42
things have worked out quite well by us being there.
-
31:46
So Cordova is low level and kind of hard to use,
-
31:49
it's not really for the faint of heart and this is
-
31:52
getting into the guts of how software projects work and we
-
31:55
also have this sort of concept of project level versus platform level.
-
31:58
So project level would be this guy.
-
32:04
Where I've got this project.
-
32:05
And platform level would be one of these guys.
-
32:09
Where I'm building a project right on the middle.
-
32:12
In the case of Android, I've got this assets www
-
32:16
folder, in the case of iOS it's in the root.
-
32:21
In the case of Firefox I believe it's in the root as well.
-
32:24
So that's the thing that they all have in common.
-
32:27
We don't stop you from working at the platform
-
32:33
level if you want to.
-
32:34
If you just want to build an iOS project,
-
32:36
you can super do that and it's totally cool.
-
32:38
You can even go so far as to ignore our command line tooling.
-
32:42
And do a painful search to find Cordova iOS and inside of Cordova
-
32:47
iOS we actually have what's called these bin scripts.
-
32:53
And so these include the ability to create
-
32:56
projects, emulate them and do whatever you want.
-
33:00
This is another kind of, interesting thing.
-
33:02
We, we initially built PhoneGap as this fancy web view that we stretched to
-
33:06
100% width and height but truly it's become more of a workflow tooling thing.
-
33:10
And so, it probably doesn't come as a surprise but building
-
33:14
projects for iOS is semantically completely
-
33:18
different than building projects for Android.
-
33:20
Like creating a project is totally different.
-
33:23
Android we need ant or possibly gradle.
-
33:25
In the case of iOs we have to use
-
33:28
XCode which is sort of like iTunes but it's Eclipse.
-
33:34
And it doesn't really matter once you
-
33:36
learn those things, but moving between those platforms
-
33:39
becomes this massive, kind of cognitive overhead
-
33:42
where you're like, how do I compile again?
-
33:44
Oh I've got to run ant.
-
33:45
And so, one of the things that we ended up doing was painting over the
-
33:48
differences so compiling emulating and logging is all
-
33:52
a bit normalized into a set of scripts.
-
33:57
We have another tool called plugman aptly named awesome
-
34:01
dude, plugman gives us the ability to deal with plugins.
-
34:04
And so this is where we get into kind of
-
34:06
the guts and the interesting things that phone gap can do.
-
34:09
Phone gaps not just a thing to create a fancy
-
34:12
web view that stretches to one hundred percent width and height,
-
34:15
it also gives you access to all of the native
-
34:17
features of the device that you happen to be running on.
-
34:19
So if you got our docks we used to have these like long API docks and.
-
34:29
Nowadays we don't, we just have what are called plugin APIs.
-
34:32
I'm sorry if this is hard to read.
-
34:33
But there are all these various plugins like,
-
34:36
I don't know, let's go to something fun.
-
34:39
Dialog, sure.
-
34:42
So.
-
34:44
If you go to plugins.cordova.io, you can see the current listing of all
-
34:49
the plugins that we've written, and other people in the community have written.
-
34:53
And these plugins expose native features, whatever they might be.
-
34:58
We turn the web view into something more powerful.
-
35:02
In the earliest versions of Phone Gap, when
-
35:04
we figured out that we could actually hook
-
35:06
up the web view to native events, one of the first things we did was Accelerometer.
-
35:10
One of the later things we did was Geolocation.
-
35:12
But we made up an API.
-
35:14
And we were like, well that's cool except that it's
-
35:17
not really scalable and it's not going to last, right.
-
35:19
If we make up some API from version to version it's not going to go anywhere.
-
35:23
And so we started to look through the W3C and how they built things.
-
35:26
And anything that has word Apache in its namespace will be an API that
-
35:35
probably has been sort of blessed by the W3C in some way.
-
35:39
Dialogues is a bad example but a good example would be geolocation.
-
35:43
So in Phone Gap 0.8 we implemented the GeoLocation spec.
-
35:48
We were the first implementors of it, we did it before the browser did it.
-
35:52
So early Phone Gap, you could get your geolocation.
-
35:54
And now that's not a normal thing to have in an
-
35:57
app but at that time that was exciting and new and different.
-
35:59
Having, like, the ability to access, you know, GPS was huge.
-
36:03
Interestingly, apps built for Phone Gap 0.8 run today
-
36:08
in your web browser because we targeted those standards.
-
36:12
And so implementing web standards turns out to
-
36:14
be a really good thing for all of us.
-
36:16
It ran on iOS, it ran on Android and now it runs on the regular web.
-
36:19
And that was kind of the goal.
-
36:21
That was sort of what we were going for.
-
36:24
So Plugman allows us to find these plugins, install them and remove them.
-
36:29
And you know what actually I should probably show that in action.
-
36:32
So I'm gonna go back.
-
36:38
Let's take a look at this registry.
-
36:39
So actually what I'll do, we'll do some fun live coding.
-
36:44
I'm in my app ready for Firefox OS.
-
36:48
Everyone's excited.
-
36:50
Is anyone, has anyone even seen a Firefox OS phone here?
-
36:56
Cool.
-
36:57
If anybody wants to see one I've got a few.
-
37:00
They're pretty rare.
-
37:03
It's a phone that's HTML, CSS and
-
37:05
JavaScript, so you can't be bummed about that.
-
37:07
So I'm a web developer and I'm going to do some debugging.
-
37:17
Hardcore Java developers would laugh once I
-
37:19
did that but this is how debug sometimes.
-
37:23
And you'll notice that I'll
-
37:29
phone gap run it, oh, really?
-
37:36
Huh.
-
37:39
Fubaz?
-
37:44
Well.
-
37:56
No!
-
38:00
Okay.
-
38:00
Okay, let's try that again.
-
38:05
Okay, I'm gonna alert, cause I'm a
-
38:07
JavaScript developer and that's how I debug.
-
38:10
PhoneGap run iOS.
-
38:15
Find it, we're gonna compile.
-
38:19
Eventually, it's gonna try and find a simulator.
-
38:22
It does.
-
38:27
Okay.
-
38:29
So cool.
-
38:30
I alerted which is a totally normal thing to
-
38:32
have to do to send a notification however you
-
38:35
may notice that there might be a giveaway in
-
38:37
this alert that I am not a native application.
-
38:41
And that super bums out your client, right?
-
38:44
He's not gonna be stoked about that.
-
38:46
Index HTML also probably doesn't build confidence in
-
38:49
your security of your app, whatever it might be.
-
38:52
And there's a good reason for that.
-
38:53
So PhoneGap applications run on the file protocol.
-
38:57
So file:// that's how we run everything.
-
39:00
We just look a www folder and we load what's in there.
-
39:03
And that's totally sweet.
-
39:04
Except for alerts are going to tell us that they're running from index.html.
-
39:12
Not all is lost cause we can run this little puppy here cordova.plugin.add.
-
39:20
You can also do phonegap.plugin.add.
-
39:23
To install our dialogue's plugin.
-
39:26
Which, I shit you not is going to install Native Code for Native Dialogues.
-
39:32
Do not look at my slack.
-
39:34
So I've got this, slightly different interface.
-
39:39
[BLANK_AUDIO]
-
39:41
Just gonna copy and paste cause I'm a
-
39:43
lazy bastard, software developer like the rest of you.
-
39:48
And underneath this hi, we're gonna create an alert.
-
39:55
We're gonna give it a message.
-
39:57
We are going to just.
-
40:00
Not allowed to call back.
-
40:02
Oops.
-
40:04
Give it a title and a button name.
-
40:06
Let's see if that works [SOUND].
-
40:13
A recompile.
-
40:19
Remember, we alerted once already.
-
40:20
[BLANK_AUDIO]
-
40:30
[SOUND] Macbook Air's, not super sweet for memory.
-
40:35
Let's try that again.
-
40:36
If
-
40:39
you're compiling stuff.
-
40:41
A lot, on these machines.
-
40:44
It's not always, compassionate to that.
-
40:49
There we go.
-
40:50
So index html.
-
40:51
The first time, oh, oh no.
-
40:53
My
-
40:56
demo failed.
-
41:02
Hm, did I save?
-
41:10
Nah we'd get a notification blurb, oh,
-
41:14
you know what it is.
-
41:16
Document at [INAUDIBLE] [LAUGH].
-
41:20
[INAUDIBLE].
-
41:29
>> So, yeah?
-
41:29
>> I think [INAUDIBLE] semicolon [INAUDIBLE].
-
41:30
>> Oh, no, that's not it.
-
41:37
That's totally fine.
-
41:38
It's because I forgot to, bind to a callback on device ready.
-
41:44
So, phone gaps asking for device ready.
-
41:48
Semicolons actually don't matter that much.
-
41:50
Douglas Crockford hates me for saying that, but it's true.
-
41:54
So, what are you gonna do?
-
41:58
I think you might have misspelled [INAUDIBLE].
-
42:01
>> Did I?
-
42:02
It's very
-
42:07
possible.
-
42:13
I did.
-
42:16
Add Event.
-
42:17
List.
-
42:19
[LAUGH]
-
42:22
[BLANK_AUDIO]
-
42:26
[LAUGH].
-
42:29
>> Wait a second.
-
42:32
Did I get that right?
-
42:33
[LAUGH] Yeah.
-
42:36
That's right.
-
42:37
Okay
-
42:37
[BLANK_AUDIO]
-
42:41
Sorry, it was a long night at the casino.
-
42:45
[LAUGH]
-
42:48
[BLANK_AUDIO]
-
42:54
Maybe.
-
42:56
Yeah.
-
42:57
So what happened there.
-
42:59
Let's take a look at that code.
-
43:02
If you go to GitHub.
-
43:04
Actually you can look in the browser, it's a, it's a
-
43:12
different plugin but it'll give you the same sense.
-
43:19
So [UNKNOWN] plugins are just like regular [UNKNOWN] kind of
-
43:22
apps in that we have a www folder where we put.
-
43:25
A little bit of JavaScript.
-
43:27
And that's where we define our interface, ultimately.
-
43:30
For the platform we might happen to be running on.
-
43:33
Most of this is totally uninteresting, except for this little bit right here.
-
43:39
Where you have this thing called exec.
-
43:40
And exec is how we do the binding back to the native code.
-
43:44
And so.
-
43:45
Oops.
-
43:46
Whoa, that was crazy.
-
43:47
If I take a look at this plugin code, I've
-
43:51
got a ww folder but I also have a source folder.
-
43:53
And in that source folder I have all the different platforms I support.
-
43:57
Including Amazon Fire OS, which is a phone you can't quite get yet.
-
44:02
And Firefox OS in other phones.
-
44:04
And if I jump into each one of these, I have native code.
-
44:07
Oh my God, super crazy!
-
44:10
And so, phone gap provides us plugin API, where
-
44:13
we can write native code, and we can plug
-
44:15
it in to any particular platform that we're dealing
-
44:17
with, and we can abstract that away and hide it.
-
44:19
And yes, this is how much code in
-
44:21
Objective C it takes, to show a fucking alert.
-
44:23
[LAUGH] [UNKNOWN] it's, it's an awesome language.
-
44:28
[BLANK_AUDIO]
-
44:30
So real talk.
-
44:32
I, I've shown you a whole bunch of hello worldy type of stuff.
-
44:36
Like I've shown you how to, basically just build something really quickly.
-
44:39
But is it actually possible to build an app using HTML, CSS, and JavaScript.
-
44:44
It is and we, we had doubts too.
-
44:48
Let's be really clear about this, it's not easy.
-
44:50
It takes, takes work and it's hard.
-
44:52
Your first inclinations gonna be to grab Twitter Bootstrap which
-
44:55
is terrible for mobile honestly, it's not designed for it all.
-
44:58
It's a megabyte of CSS for fuck's sakes, it's huge.
-
45:02
[UNKNOWN] pretty good.
-
45:03
And so, it's a better answer.
-
45:05
We created a top code as a way to look
-
45:07
at this problem, and to look at it very discreetly.
-
45:09
If we look at things like Twitter Bootstrap and
-
45:11
[UNKNOWN] Foundation, these are all in one, [UNKNOWN] massive frameworks,
-
45:15
with a ton of CSS and a ton of JavaScript, and a ton of images and a ton of fonts.
-
45:19
And you probably only use it for buttons.
-
45:21
And [LAUGH] it doesn't load well on mobile.
-
45:25
Weird.
-
45:26
So we decided to create something that was just
-
45:28
discreet and just CSS and addresses particular performance consideration.
-
45:33
When we look at performance.
-
45:35
You know, the network is bad.
-
45:36
We don't know, if we're online or offline even.
-
45:39
If we look at the execution runtime, it's kinda bad, you know?
-
45:43
We're on like, now we, we, we see quad-core phones, it does happen.
-
45:47
But, they're crummy.
-
45:48
[COUGH] >> Quad-core phones.
-
45:50
Layout and the Rendering, with the web.
-
45:52
I mean, we can't even fucking, vertically center stuff, it's terrible.
-
45:55
And so you look at the web and you go like wow, this totally sucks, so [UNKNOWN]
-
46:01
who I believe is doing a talk tomorrow, and is brilliant and is
-
46:07
worth your time to listen to and to learn from proposed the idea of Mobile First.
-
46:13
And we love this.
-
46:13
We're like, yeah, built for Mobile First.
-
46:15
And then everything's gonna be super easy.
-
46:17
Except, we don't even know what the fuck mobile means anymore.
-
46:20
It's mobile, like a computer that's on my face.
-
46:23
Is it like a watch, actually, there was a [UNKNOWN]
-
46:25
image on Twitter the other day, when someone, was like,
-
46:28
I invented a new smart watch, and they just drew
-
46:30
a watch on a wrist that said, you always have email.
-
46:34
Which I liked a lot.
-
46:35
[LAUGH] >> So what's mobile?
-
46:37
We don't know, and so I was throwing out the
-
46:39
idea that we, what we actually need is performance first.
-
46:42
What we need to do is think about
-
46:43
performance as like, kind of your fundamental idea.
-
46:45
When you're building your applications, we need to be fast.
-
46:47
Except if, if we really take performance first to its absolute
-
46:52
conclusion, we're gonna start writing assembler, she's not actually efficient.
-
46:58
That's not what people wanna do, so I was like you
-
47:00
know, performance first is actually kinda, not, not a cool way to
-
47:03
look at it, and what we, what we really need to think
-
47:05
about is like the people building applications, like who are these people?
-
47:08
Like, we need to think about the developers, is it maintainable?
-
47:11
Is it reuseable?
-
47:12
You know, can we build apps truly?
-
47:16
And that wasn't actually tenable either, and I
-
47:18
wanted all this goals and so I took all
-
47:20
of my new founded Adobe management experience and I
-
47:23
brainstormed really hard, and I came up with this.
-
47:27
What we need is mobile performance people first,
-
47:30
until [UNKNOWN] with you I didn't actually think that.
-
47:33
So it was productivity is an important part of this and reuse is an
-
47:36
important part, when you're building the applications,
-
47:38
you end up with, a dogpile situation.
-
47:41
You end up with a bunch of CSS that you included from a framework.
-
47:45
[LAUGH] Come on in.
-
47:47
It's cool.
-
47:48
So, so you use Twitter Bootstrap, great.
-
47:51
But you need a button that's slightly different in the Twitter Bootstrap button.
-
47:54
So, what do we all do?
-
47:56
We copy and paste the old button and then we change it a little bit.
-
48:00
Maybe we'll throw an important on there in a zed index of 999 just to be safe.
-
48:04
And then somebody else needs a button and so we end up with
-
48:06
this dogpile that is totally not actually productive, for what we're trying to do.
-
48:12
Lyza Danger Gardner wrote an amazing article on
-
48:15
a list apart called, Do as little as possible.
-
48:17
And being a burned out stoner skateboarder,
-
48:20
I am super stoked on this philosophy.
-
48:23
I think doing as little as possible is not
-
48:25
actually a way of saying I don't wanna do anything.
-
48:27
It's saying let's do what counts, right?
-
48:30
Fastest code is no code.
-
48:32
We had a client come to us once, by Toby, and they were
-
48:34
like imagine Facebook, but with like ten times as many features, on your phone.
-
48:41
Wouldn't that be awesome?
-
48:42
I'm like no, [LAUGH] that's terrible.
-
48:44
That's an awful idea.
-
48:46
We don't want that at all.
-
48:47
We want like the simplest thing that could possibly work.
-
48:51
A part of building performing apps is also measuring absolutely everything.
-
48:54
So these tools are now maturing a, a while ago this
-
48:59
was not really possible but now we can get into actual.
-
49:01
Performance and window timing metrics.
-
49:04
So, we are looking like okay, we hear everyone has performance problems.
-
49:08
We know that the maintenance of these things is terrible because everyone
-
49:11
dogpiles CSS and we also found that between Twitter, Bootstrap and three.
-
49:15
Did anyone do that upgrade?
-
49:17
No you didn't, because it sucked.
-
49:18
You just built other apps.
-
49:20
It's really [LAUGH] hard to do.
-
49:22
We also had other motivations in Adobe, where
-
49:25
we wanted to see if we could build apps.
-
49:27
We built a thing called reflow and a thing called brackets using
-
49:30
HTML, CSS and JavaScript and we wanted to build discreet small reusable components.
-
49:34
So our first cut at topcoat was the CSS library that gave us
-
49:37
lists and buttons and that sort of thing we built the Adobe MAX
-
49:40
application, but we didn't tell anyone that we built it, and everyone was
-
49:44
like, man this thing is awesome, you guys should have built a PhoneGap app.
-
49:49
We're like no it, it is.
-
49:50
And they're like no, no, this is really fast.
-
49:52
[LAUGH] We're like no it really is.
-
49:55
So Top Code's got some basic design goals.
-
49:58
It's discreet, it's modular, it's
-
50:00
extensible, it's friendly, it's open source.
-
50:04
I don't have time to show it to you but you can check it out at topcode.io.
-
50:10
If you're interested there is zero prerequisite to even try it out.
-
50:15
It's kind of interesting.
-
50:16
We built it with benchmarking in, in mind where we would take every commit and
-
50:22
we would measure the speed of that commit
-
50:24
on frames per second, layout and execution time.
-
50:27
All that code actually is now kinda in the browser and reusable.
-
50:31
And then we generate a style guide for you.
-
50:33
Depending on like what platform you're on and
-
50:35
we give you a bunch of reuse, reusable components.
-
50:38
We give you little code snippets where you can copy and paste from.
-
50:41
We had some good advice from a software developer who is much smarter than me.
-
50:45
He's like listen Brian, everyone is copy and pasting anyways, so
-
50:49
you may as well give them something good to copy and paste.
-
50:52
Which is, probably really smart.
-
50:57
So the question that I've asking lately if you look at Chrome OS, Win JS,
-
51:03
Firefox OS, Samsung and Intel's Tyzen and even WebOS which is owned by LG.
-
51:10
All of these are web based operating systems.
-
51:13
We think about it, Google, Microsoft, Mozilla, Intel, Samsung, and LG are
-
51:19
all betting on the future, of operating systems being a web based kind of future.
-
51:25
In the meantime, you can hit all these bad boys with PhoneGap if you want to.
-
51:29
Interestingly also, all these app stores are embedded web views themselves.
-
51:35
There's some perceived competition out there.
-
51:37
I don't think that's actually useful, it's an
-
51:38
open source project, we learn from each other.
-
51:40
That's sort of my take away on that one.
-
51:42
But we've got a bunch of tools and
-
51:44
outputs that you can check out if you're interested.
-
51:48
We're very empirical, we have the idea of performance built into what we're doing.
-
51:52
You can use all of it or none of it.
-
51:56
And, you should just go and build a kickass app.
-
51:58
[APPLAUSE]
-
52:04
We maybe have like a minute for questions, or you could just buy me a beer later.
-
52:09
Or I'll buy you a beer really.
-
52:12
And I owe Cable guy a beer.
-
52:15
So thanks.
-
52:16
Does anyone have a question?
-
52:19
Do like one or two.
-
52:20
Yeah.
-
52:20
>> I already have an app.
-
52:23
How much work.
-
52:23
I wasn't planning on going mobile, but I want to know
-
52:27
how much work will I have to do to get ready
-
52:31
>> Is, is it a single page web app?
-
52:32
>> It's, it is.
-
52:34
It's a media app.
-
52:36
>> Yeah, it will work.
-
52:38
You'll have to be responsive to a handset form factor or
-
52:42
possibly tablet if that's what you're going for, but that's it.
-
52:46
Yeah, one of the interesting fun things
-
52:48
that we learned by stretching that web view.
-
52:50
Whereas, you know, a web view that stretches
-
52:52
so any kind of responsive design programming style will
-
52:56
work inside a PhoneGap the same way it would
-
52:58
work as you were building for a regular browser.
-
53:01
Yeah, it's, it's, it's literally ten minutes to figure it out.
-
53:06
We have an app in the app store which
-
53:08
I should have mentioned If you go to app.phonegap.com.
-
53:14
And you install, one of these apps for one of these platforms.
-
53:18
You compare it to your local machine and try PhoneGap without installing anything.
-
53:23
It'll take you like two minutes.
-
53:25
So, maybe you can figure out if it works.
-
53:27
Yeah.
-
53:28
>> If you have a mobile website like.
-
53:29
[INAUDIBLE] our app in the mobile.
-
53:32
Is there any [INAUDIBLE] in using PhoneGap to make [INAUDIBLE].
-
53:36
>> It depends.
-
53:36
I, I don't like people doing that truly but my opinion is extreme and
-
53:40
harsh, but I know, I think these app stores are an aberration and a mistake.
-
53:45
I don't like the idea that I have to pay $100 to
-
53:48
Apple to build something to a device I already fucking own, but.
-
53:52
You know, the app store is a discovery channel.
-
53:54
So, is, is it worth it?
-
53:58
Probably we've got examples of PhoneGap apps that I, you know, I would preferred
-
54:04
they didn't exist but they, they do like 5,000 downloads a day or more.
-
54:09
So, yeah.
-
54:10
It's probably worth wrapping.
-
54:12
It's a discovery channel.
-
54:14
I don't like it, but that's how it works.
-
54:16
I used to, I used to say device APIs
-
54:18
and offline were important, but the web has caught up.
-
54:20
Sorry.
-
54:21
Yeah.
-
54:22
[INAUDIBLE].
-
54:26
>> Yeah.
-
54:26
So we, we work with all [UNKNOWN] earlier I was sort of joking about how
-
54:34
Like, here's my project fubar, and I've got platforms
-
54:37
iOS, I can jump in there and launch Xcode.
-
54:40
If you haven't seen Xcode, it's basically
-
54:43
like, imagine if Eclipse looked like iTunes.
-
54:49
It's just a native project so you can totally
-
54:51
use all the native tools that you want to use.
-
54:54
There's nothing stopping you.
-
54:55
And we can compile from here.
-
54:56
>> Nothing?
-
54:58
>> Debugging, everything, yeah.
-
54:59
[BLANK_AUDIO]
-
55:05
>> Yeah, Eclipse, or Android Studio if you hate yourself.
-
55:08
You can use all those tools.
-
55:10
[LAUGH].
-
55:11
>> Yeah?
-
55:12
[INAUDIBLE].
-
55:14
>> Sorry?
-
55:15
[INAUDIBLE] >> yeah, yeah.
-
55:20
So there's, there's plugins to do that for various platforms.
-
55:26
Totally.
-
55:26
In fact PayPal uses PhoneGap.
-
55:29
So [INAUDIBLE].
-
55:32
[INAUDIBLE].
-
55:34
>> You would, and you would have to do that
-
55:36
if were writing native code too, so, there's no difference there.
-
55:40
Yeah.
-
55:41
[INAUDIBLE].
-
55:46
>> We have an upgrade command it's not always compassionate, truly we play
-
55:51
cat and mouse right, like we are, we are always chasing whoever updates last.
-
55:56
And iOS 8 is, you know, our latest bug bearer that we are dealing with.
-
56:00
we, the upgrade command probably will work between
-
56:05
versions of an operating system, but in a major
-
56:08
upgrade, like iOS 7 to iOS 8, you'll
-
56:10
probably just be able to reuse the ww folder.
-
56:12
The platform folder you will probably have to blow away and re, re-add.
-
56:16
[INAUDIBLE]
-
56:19
>> Again, we keep those all updated, and it's the same situation.
-
56:21
You'll have to blow them away and add them again.
-
56:24
But I, we try and treat platforms and plugins as build artifacts.
-
56:28
We let people still modify that because we don't wanna get too, into it.
-
56:32
Yeah.
-
56:35
You can, keep those around and upgrade them if you want to.
-
56:37
Oh, I'm getting kicked off.
-
56:41
Thanks everyone.
-
56:43
[LAUGH].
-
56:45
[APPLAUSE]
You need to sign up for Treehouse in order to download course files.
Sign up