ALEXIS MOUSSINE-POUCHKINE: Hi everyone.
We're here at Devoxx 2014 in beautiful Antwerp, Belgium.
It's kind of cold today, actually.
And I'm here with my guest to talk about Chrome Apps
everywhere.
And maybe you can introduce yourself.
ANDREW GRIEVE: Sure.
So my name's Andrew Grieve, and I work on the Chrome Apps
for Mobile project.
Yeah, I've been doing web development for the past six
years at Google, and it's always an exciting time.
ALEXIS MOUSSINE-POUCHKINE: Yeah.
The web is an exciting place.
And it's always a good time to be developing for the web.
So Chrome apps and mobile, so these are probably
the two things we'll talk about.
The first one, Chrome apps.
Can you maybe redefine this for those that haven't heard of it
or need a refresh.
How do they differ from web pages or web extensions?
ANDREW GRIEVE: Sure.
Sure.
So Chrome apps have had-- it's actually
a fairly short history.
As we know them today for desktop,
they were only made available late 2012,
so only a couple years old.
And the big difference from web pages
is really that they don't run within a browser tab.
So they have to run in their own window,
and this distinguishes them from regular web apps.
So you get them through the Chrome Web Store.
They are downloaded and installed.
And the main reason why you'd want them over a regular web
app is that they have permission to use more powerful APIs,
so things like the user's identity, raw sockets,
or synced storage, some really more powerful and compelling
APIs.
ALEXIS MOUSSINE-POUCHKINE: So there
are two things you mentioned.
The first is the actual-- its own window.
It probably means it can be totally immersive
and you don't really know it is powered
by a web engine or a rendering engine?
ANDREW GRIEVE: Right.
That's right.
ALEXIS MOUSSINE-POUCHKINE: Maybe you want to comment about that.
And second question is about the security aspect.
It is very secure, though.
Although it has those additional powers and APIs
to access the hardware and all that,
it is very secure at the same time.
So maybe you want to comment on those two things.
ANDREW GRIEVE: Yeah.
So as you were saying, not only do they run outside of a tab,
but they run as their own window and separate from the browser.
So that means they have their own desktop icon,
they have their own Alt tab entry.
And to most users, they'd be really hard pressed
to figure out that they were built on web technology.
ALEXIS MOUSSINE-POUCHKINE: Yeah.
They're very-- there's native integration
with the OS, whichever OS that is.
ANDREW GRIEVE: Exactly.
And as far security goes, you also are right on point
there as well, that in general, they
are more secure than typical desktop applications.
I mean, a large part of that is just because it's
built by the Chrome team, and I've really never
been on a team more paranoid, I guess,
about security than the Chrome team.
So all the apps run in sandboxes.
And there's really locked-down capabilities
of what they can do.
ALEXIS MOUSSINE-POUCHKINE: So there's a content security
policy that's-- you need to have one.
You can't run without one.
A regular website could, but a Chrome app cannot.
ANDREW GRIEVE: Right.
So content security policy is a fairly new HTML5 kind of API
that's come out in it.
And it is available for use on the open web.
But it's an opt-in thing.
So for Chrome Apps, the difference is it's not opt-in.
You must use it.
And it really just helps prevent mostly against XSS attacks.
And the rationale there is really
just because we're giving you these more capable and powerful
APIs, so the risk is kind of even greater to attacks.
ALEXIS MOUSSINE-POUCHKINE: And part of these things,
Chrome apps have been out for a little while already.
We have good examples of popular apps that have been built
and that people are using.
But what is new, I would think, is the ability
to build mobile apps nowadays with the same technology.
Oh, and by the way, Chrome apps are
being built with web technologies,
as I think people have understood by now.
It's all about JavaScript, HTML5, CSS.
So take those skills that you have,
those tools that you have to build
desktop-like apps, but also mobile apps nowadays.
So how does that work?
ANDREW GRIEVE: Right.
So that is what I'm more intimately familiar with.
That's what I've been working on for the past two years.
So Chrome Apps for Mobile is actually
just still in a developer preview phase.
So there are some, I think, pretty compelling apps being
built with it currently, but it's still hot off the press.
And you can mostly think of that as a Cordova application.
There's not a huge difference between a Chrome App
for Mobile application and a regular Apache Cordova
application.
So Apache Cordova is a fairly long-lived project,
which makes it easy to create HTML and JavaScript
applications and deploy them to mobile platforms,
as true native apps but built with web technology.
ALEXIS MOUSSINE-POUCHKINE: So how
would that differ from me building, say, an Android
native app using a WebView?
ANDREW GRIEVE: So actually it wouldn't differ all that much.
So Cordova applications, in general,
are a WebView taking up the entire page
and rendering your UI that way.
So the biggest difference, I would say,
is it provides an abstraction that
lets you target multiple platforms.
So iOS, Android is what we support
on Chrome Apps for Mobile, and then Cordova itself supports
pretty much every mobile operating
system that you can think of.
ALEXIS MOUSSINE-POUCHKINE: But do you
need to develop to some very lowest
common denominator in terms of what a WebView can support?
I know one of the nice, very new features,
I believe, in Android is the fact that the Chrome WebView is
now something that is being updated
on a very regular basis.
It's been externalized.
ANDREW GRIEVE: Right.
ALEXIS MOUSSINE-POUCHKINE: You get
take benefits of having WebGL in the Chrome WebView on Android.
You may not be able to do this on all the platforms.
So how does a developer deal with that?
ANDREW GRIEVE: Yes so this was historically
a really kind of growing problem for the project
for a long time.
And it's only recently kind of been
addressed in a meaningful way.
So I'm really happy to say that there
is a meaningful answer here.
So like you said, as with Android L
this system WebView is based on Chromium,
I believe M37 at launch, and it is updatable outside
of Android updates.
That's awesome.
The iOS WebView, as of iOS 8, they
came up with a brand new WebView.
Now it has accelerated JavaScript and WebGL as well.
So very capable there.
And iOS system updates are quite well adopted.
Of course the question still is, what
about people that aren't running Android L, which
has been out for approximately one day now.
So our answer, at least, there is the Intel Crosswalk
open source project, which is a bundling of the Chromium
WebView inside your application.
So there's a couple trade-offs, mainly the size of it.
It adds about 17 megabytes to your APK size.
But for most, we haven't heard that this is actually
a big problem.
And it lets you use the latest and greatest WebView
on all Android targets.
ALEXIS MOUSSINE-POUCHKINE: So walk us maybe a little bit
through the workflow, the tooling, the APIs.
I want to start my "Hello, World,"
and probably move a little bit beyond that
and build my first Chrome App-based mobile app.
What does it take?
ANDREW GRIEVE: Yeah.
So there's a couple of options there.
I'd say the easiest just for building a "Hello, World,"
and toying around a little bit is
to use the Chrome Dev Editor.
So this is, again, a project that
was announced at the last Google I/O this summer.
And it's an ID which is actually built as a Chrome app itself.
So that's kind of cool as a technology demonstration.
But it's ID just for building from Chrome Apps.
So there's templates in there.
There's a Play button.
If you click Play, it'll open your application
as a desktop Chrome App.
And then if you use the drop-down menu in our companion
tool for the Chrome App Developer tool for mobile,
then there's a Deploy to Mobile Device button.
So you could easily, without installing any SDKs,
play around with what your app would look like
both on mobile and on desktop.
ALEXIS MOUSSINE-POUCHKINE: Yeah.
So the time to "Hello, World" is very
short in this-- I mean, no SDKs.
ANDREW GRIEVE: That's the quickest path
to a "Hello, World," for sure.
ALEXIS MOUSSINE-POUCHKINE: And eventually, I
do build this awesome app.
And I just package this and distribute this
through traditional Play stores or Apple stores.
Right?
That's how it works.
ANDREW GRIEVE: Yeah.
Yeah.
For mobile, exactly.
So the App Store and iOS or the Play store on Android.
Once you get past your typical "Hello, World,"
you want to install our command line tools.
So we have-- Cordova's tools are based on Node.js,
as are ours, for Chrome Apps for Mobile.
And we give you kind of a Ruby on Rails style--
ALEXIS MOUSSINE POUCHKINE: Scaffolding.
ANDREW GRIEVE: Yeah, exactly.
You can do-- CCA is the name of the tool.
So cca Create Project, cca Build Android.
And that's about the extent of it,
so you need to install your SDKs at this point for this tool.
But then we give you a nice wrapper around them
to just say cca build Android, cca build iOS.
And then that's what you upload to the stores.
ALEXIS MOUSSINE POUCHKINE: And I'm
pretty sure having command line also
helps with continuous integration
and integrating this in any build environment
and development environment that developers have.
ANDREW GRIEVE: Yeah.
ALEXIS MOUSSINE-POUCHKINE: So web developers
love using frameworks or libraries, whatever
you want to call them.
Does Chrome Apps recommend against
or to use some libraries, if any,
especially in the mobile case?
ANDREW GRIEVE: Yeah.
I mean, that's mostly a question we
try to stay out of a little bit.
There's new frameworks popping up all the time.
I'd say our project goal is to give you
the awesomest, most powerful blank canvas
to work with as possible.
ALEXIS MOUSSINE POUCHKINE: Right.
So you're not mandating anything.
ANDREW GRIEVE: Exactly.
So Polymer, I think, is a promising project.
Angular, I've had good times with.
Ionic is a really popular Angular-based framework
for Cordova-based applications, which
works just fine for Chrome Apps for Mobile.
I mean, my personal advice is to spend the time
to at least understand what these frameworks are doing.
But I wouldn't say I have a strong preference for any
of them.
ALEXIS MOUSSINE POUCHKINE: Choice is good.
I like choice.
So maybe to close off, you're here presenting at Devoxx.
And I think you also have some tips or information about what
kind of paradigm works for developers.
Maybe mobile apps.
I mean, the things that really work well,
things that don't work all that well that people shouldn't
maybe use yet or at all, because it's just
not the way they should build things in this environment.
Do you want to tell us more about this?
ANDREW GRIEVE: Yeah.
So I do have kind of developer guidance, I would say,
tips and tricks in my talk.
Mostly I'd say what works well is just--
the main thing I find is just make
sure you have that fast feedback loop when you're developing.
And that's kind of one of the best things about developing
for the web platform wherever you are.
So for Cordova applications, the main trick there
is to remember that you're building using web,
so it doesn't take much to make your mobile application
run on a desktop browser.
And Chrome Dev Tools emulation mode
gives you a really easy way to make
Chrome pretend like it's a mobile device
and shrink your view port and whatnot.
It's really fast and convenient.
So it's no replacement for testing on device,
but it certainly makes for a compelling workflow.
ALEXIS MOUSSINE POUCHKINE: Great.
So what is the status of this project altogether?
I mean, can people use it today?
And would you recommend people shipping
apps built on top of that today?
ANDREW GRIEVE: Yeah.
So I'd say every application has different requirements.
Certainly for some, this would be a perfectly reasonable
platform to use today.
There are some rough edges around us finishing up
the Crosswalk integration, for example.
For example, we haven't yet updated cca
to support the iPhone 6 Plus icon sizes.
So we'll have that done probably next week, some rough edges.
But I'd say for the most part, we're ready.
We've responded quickly to our bug tracker on GitHub.
ALEXIS MOUSSINE-POUCHKINE: And this
is a good time to mention that this is a fully open source
project.
ANDREW GRIEVE: Yes.
ALEXIS MOUSSINE-POUCHKINE: So if people
want to support, help, or at least know what's going on,
it's done in the open.
ANDREW GRIEVE: Exactly.
Yeah.
ALEXIS MOUSSINE-POUCHKINE: OK.
Well thank you, Andrew.
That's, I guess, all the time we have for it.
So thank you for answering my questions.
And we'll be seeing you soon.
Online probably.
ANDREW GRIEVE: All right.
Thanks.