BT

Brian LeRoux on Mobile Web vs. Native, PhoneGap Build, Firefox OS
Recorded at:

Interview with Brian LeRoux by Werner Schuster on Nov 19, 2012 |
22:28

Bio Brian LeRoux leads the open source PhoneGap project team at Adobe (also at Apache under the name "Cordova"). He's been with the PhoneGap project from its very humble beginnings at Nitobi Software.

GOTO Aarhus is the enterprise software development conference designed for team leads, architects, and project management and is organized by developers, for developers. Important topics are presented by the leaders in our community. The conference concept is to present the latest developments as they become relevant and interesting for the software development community.

   

1. I’m sitting her with Brian Leroux of Adobe today; so Brian PhoneGap, is it still called PhoneGap, is it Cordova, when is the next name change announced?

Yes, okay; so there’s definitely been a lot of confusion about the different names and last year when Adobe acquired Nitobi, we donated the source code of PhoneGap to the Apache Software Foundation and it was accepted for incubation under the name of Apache Cordova; it was actually accepted under a different name but we’re going to pretend that didn’t happen; so now the thing is like PhoneGap is a distribution of Apache Cordova; lots of people are distributing Apache Cordova, it’s inside of products Oracle, SAP, IBM so people are using Cordova openly.

PhoneGap is the consumer distribution by Adobe; right now it’s exactly the same source code; there’s talk that we may integrate it back to PhoneGap Build at some point this year; if you don’t have an SDK installed then it will look out to the cloud and it will use your PhoneGap Build credentials to build your application so that could happen.

   

2. So when you say consumer version of PhoneGap, what’s consumer-facing about that? Or do you mean developer?

I guess, yes, I mean developer so I guess the corporate thinking is getting into my head and I’m using these weird terms; so it’s the end developer that’s using PhoneGap, yes.

   

3. You already mentioned PhoneGap Build; what do you do with that?

So PhoneGap Build let’s you build PhoneGap projects using our servers; we’ve been in beta for about two years, fine tuning it, figuring out how it would work, making it faster, and adding a few features; so first thing when you’re building an application on your local machine, you don’t want to run like six compilers at once; it’s going to be really slow unless you have a really powerful machine and odds are you don’t have all the operating systems either; so, you know, if you’re building Windows Phone, you have to have Windows; if you’re building iOS, you have to have iOS; so PhoneGap Build lets you run that compilation all at once and we’re starting to build in some instrumentation stuff.

So one feature that I’m excited about is called hydration; when you push new code, we pull it down and then we push it on to the device so you don’t have to do a recompile; when you compile for like say Android, it takes roughly 30 seconds to 2 minutes which is not bad; but when you’re doing classic web dev which is all PhoneGap is in a browser, you know, you just have to reload so it’s way quicker; the hydration thing I think our times are around two to three seconds on a fast network so it’s way faster than compiling which is a big win.

   

4. So hydration is that it pushes the JavaScript to the PhoneGap; does that use app cache in some way or is it just reloading it?

No; the WebView doesn’t have an app cache; so PhoneGap apps kind of they live on the phone and they’re served locally off the phone; so we’ve got this little tiny service running on the device; for PhoneGap Build based applications, it will go fetch new assets and then install them on the device; but it only gets to static assets so you don’t have to recompile the native bits.

   

5. So what platforms do you support nowadays? Or which don’t you support, let's take the shorter list.

Well I can rattle them off; so iOS, Android, all Blackberrys so even Blackberry 10 which isn’t really consumer available yet, Windows 7, Windows Phone 7, Windows 8, Windows Phone 8, all Blackberrys, oh man, what am I missing, I’m sure I’m missing stuff, WebOS is supported, Tizen is under development right now; did I mention Android, I must have; all the Androids back to 2.1.

   

6. Do you still support Symbian?

We still have Symbian source; I don’t know if anyone is actually building Symbian apps; oh, that reminds, me Bada is another one - Samsung’s.

   

7. Samsung is also involved with Tizen, I think?

Yes; Samsung and Intel are doing Tizen and that’s supposed to be out sometime next year; we have a reference implementation already built; it runs on emulators and it runs on their sort of demo brick devices so we’ll be ready for it when it comes out; it’s another kind of web operating system so very much like WebOS; or actually there’s another platform that we support, Boot to Gecko which is now I think Mozilla’s current Firefox OS.

   

8. What do you ship to Boot to Gecko, just JavaScript or any binaries?

Yes; so they built, they have this kind of standards group called Web API and they tracked all the stuff that was happening at the W3C and now they’re working with the W3C in a new group called Sysapps and we’re working with them; so the long story short is all these APIs are really similar; they’re basically asynchronous APIs backed by device APIs so you know geo location, accelerometer, so it’s just a shim; it’s just JavaScript.

   

10. So how do you use PhoneGap Build; do I have to push my code to it?

Yes; so not to it; we used to do Git-Hosting then we realized that there was this other service that does it pretty good so we thought we’ll let those guys do it, GitHub; so we basically are integrated back with GitHub; you push your code to your GitHub repo and then we’ll pull from there under our service to do compilation; it’s a little bit neater of a model and it doesn’t require us to have to run Git servers in addition to all these other operating systems that we’re running; it was a little bit fragile so we thought we’d leave that to them; everybody is hosting GitHub probably anyway so, yes.

Werner: It’s one step less.

Yes; one less remote basically.

   

11. Absolutely, yes; so I’m going to push my code to PhoneGap Build, get back so for iOS I get back some package in some way or can I push that to a device too?

Yes; in fact you can just install it straight on to the device; you have to give us your signing keys; this is Apple ceremony but just like TestFlight app we support install from the QR code or a URL; so you build and you give – you know, we give you back this QR code and then we actually detect what device is trying to download the assets and we’ll send them the right thing; so if it’s an Android trying to download it, we’ll send it an APK down; if it’s iOS, we send an IPA down which is the install package format for iOS.

   

12. So once I’ve built my application and I want to debug it, do you have any support and solution for that either in PhoneGap Build or in PhoneGap?

In PhoneGap Build we have something called weinre, web inspector remote, and so we’ll instrument the app with this little chunk of JavaScript and it will let you run a remote web inspector instance against the device; in iOS 6 actually so if you’re doing native PhoneGap development or just like regular PhoneGap development on your machine, your local machine, iOS6 allows web inspector to connect directly to your iOS WebView inside of PhoneGap; unfortunately this capability isn’t available for Android but you do have remote Chrome now so if you’re doing your development just in the browser, you can do that too; so the remote debugging story is getting better; it’s not perfect and if you want to have like step debugging I think it’s basically iOS, Blackberry, and Windows phone right now have that capability but Android ironically does not.

Werner: For the Opera community, we have to say Opera always supported remote debugging.

I’m sure yes, Opera probably supported it ten years ago.

Werner: Right, yes because I want to avoid getting comments on the post

Yes, right.

   

13. So PhoneGap Build do I have to sign up, I mean do I have to pay you, can I get stuff for free?

It’s free; yes, we follow the GitHub like model there too; so it's free for as many open source applications as you want and it’s also free for one private application so you don’t have to share your source for one of the apps which is nice; and then the pricing is pretty reasonable I think; I think it works out to like $10.99 a month for essentially unlimited use.

   

14. And that’s basically a service Adobe offers nowadays?

Yes; it’s part of the Edge family of tools which are all the sort of web platform tools that we offer to Adobe and PhoneGap tools at the mobile side of that story.

   

15. So what are any other interesting projects Adobe is involved in that maybe concern PhoneGap or other web products?

Yes; so well I’m on the web platform team and that team is kind of divided into two areas; there’s a tooling team and then there’s the open source teams; the tooling team and then there’s sort of like guys that work in between; so the tooling team does things like Edge Animate, Edge Inspect, Edge Reflow which we just announced and then kind of like halfway in between the tooling team and the open source team, we have Brackets which is our open source code editor that we’ve been working on and then right way over into the open source side, you’ve got Apache Cordova and our Webkit; and basically the Webkit team is working to facilitate all the ideas that we have for what we want to see in publishing for the web; so right now web content, it’s good, it’s getting better but it’s not as expressive as some other formats and so we want to fix that and then we want to build the tools to publish to it; so the first sort of movements that we’re seeing out of our Webkit contributions are CSS shaders and filters, regions and exclusions; so all sort of new high powered CSS features and that’s going to allow our publishing tools to like target those features and give designers like better capabilities for expressing stuff.

I guess I should mention too there’s type kit and then there’s Edge Web fonts which is kind of like open free, open source free fonts for people to --

   

16. So these are web fonts basically?

Yup, web fonts; there’s a whole bunch of good ones, I’m blanking right now but there’s one that I particularly love called Source Sans Pro which Adobe made.

Werner: For code editors I think.

Yes, yes, and it’s inside Brackets but I’ve added it to vi too, it looks great; yes.

   

17. So these CSS additions that you mentioned, are they in some terms standard, are they HTML5, 6, CSS3, 4, 5?

I think they are fuzzily in CSS3 in some form. CSS filters have landed in Chrome Canary and I know we’re working with the W3C on standardizing this stuff, so you know, that’s a little bit of a longer process but Adobe is putting their money where their mouth is instead of just like working on the standard side, we’re actually building implementations too; one angle to all this too that should stress is that we don’t believe that the web is just Webkit, it’s not that, we’re just going to be contributing there; the Cordova team is looking heavily at Firefox OS too but that’s sort of a different beast altogether.

   

18. So let’s look at another aspect of PhoneGap the PhoneGap model basically; you’re running a native application; it has a WebView in it basically. So on iOS for instance, there’s the problem that JavaScript runs slower in web views; is that still the case, is that a problem?

That’s a good question; yes and it’s happening and it’s an issue; so one way I would tweak that though is that we’re not running slower, we’re just not running as fast as the web view; so WebView has seen performance improvements or not WebView but mobile Safari namely from Nitro; so Nitro right now is about three times faster than the embedded WebView so mobile Safari is just quicker; but that didn’t mean that the embedded WebView got slower, it just means that the WebView is getting or the mobile Safari s getting faster; and then the other kind of angle is this has been over the last few versions of iOS and the big reason that Nitro is so much faster now is because the phones are better, the phones are getting faster; so now that’s glossing it over like yes, obviously we want it faster; the WebView speed is what would stop people from making faster applications and the better the JavaScript execution run time then the better for all of us; yes.

   

19. That might go away at some point I guess the speed difference?

Oh, yes. I’m being cagey there. So I’m like I’m certain it will; I mean you know, a lot of people are trying to like come up with conspiracy theories that Apple is out to kill the web; they contribute more than anyone back to Webkit right and this is easily one of the best mobile web browsers; it’s what Chromium based on; I’m certain they know the issue exists and I’m certain they want the best by web developers but they probably have a lot to do like maps for example.

Werner: Well Apple Maps is fine; I found here perfectly all right.

Yes, it’s true, yes.

   

20. Although, I didn’t use Maps. And I think that the Nitro problem is mainly one of security where they keep, they can’t have a JIT inside WebView applications?

I’ve heard that too; I suspect that the mobile web browser might be a larger surface for attack but perhaps yes that could be an issue; I don’t know; like I’ve heard that reasoning; I don’t necessarily buy it but hey I don’t really know what they know about their own stuff; they’ve left it out now for I think two releases of iOS so maybe it is a really tough security problem; but, you know, you’d think that if their reasoning is security that they wouldn’t have it enabled in the mobile web browser but… Yes; who knows, maybe it’s a different privilege model for that app or something I’m not sure.

Werner: Presumably, yes.

Yes.

Werner: So talking about native applications with web views, recently Facebook announced that they moved their application, their mobile application on iOS to native which isn’t actually true; I think they still use WebView or HTML for some things I think.

They do.

   

21. So has the PhoneGap model failed?

Well, okay so Facebook was at PhoneGap Day EU and Simon Cross gave this awesome presentation and I felt really bad for him because he opened the conference; so can you imagine, Mark Zuckerberg makes his announcement, two days later he’s at the PhoneGap conference so he was looking now for rotten tomatoes to fly or whatever; so Facebook is totally obviously okay with the web and web technology and when you’re a company of Facebook’s scale, you’re going to probably execute on more than one strategy; something that everybody has glossed over along the way too and this is just personal conjecture and my opinion and, you know, mine alone, but iOS6 integrated Facebook natively so it probably had access to different API level security than other areas of the operating system that most apps aren’t enjoying; so a rewrite was probably necessary.

The web code they were writing was not the greatest and I don’t know what their investment or resourcing situation was so they probably just didn’t have like … So building a WebView that scrolls is not hard, you can do this; in Facebook in fact their app was not terrible if you got rid of all the blocking script tags, which was the issue; when you were scrolling, it would be janky; it was just how it was implemented and I guess there was a whole bunch of forces at work where they decide to shift their focus; but, you know, they’re still very much a web centric company; they’re contributing back to PhoneGap actually and they encourage a lot of people obviously to build on their platform using web tech so.

I don’t think it – like the pundits made a really big deal of it and it really wasn’t one; it was a bit of probably a goof on Zuckerberg’s part to make that statement but…; yes, I think the web is going to be all right. Says a guy on a video on the internet. We’re on the internet right now.

   

22. If you look at the people who use PhoneGap, do you see a trend of who uses it for what type of applications; is it publishing or what’s a good--

Well, yes; kind of, so like there’s a few weird trends; so early on it was mostly hobbyist web developers then it kind of grew into like corporate businesses that were trying to get their content on the web or they had like an existing investment like web tech they had built big intranets or whatever and they didn’t really care; they just wanted to get it out to mobile; then of late and this is more of a demographic shift than anything else and we don’t really understand it ourselves but we’ve got some new stats and we haven’t rolled them all out but we’ve published them a bit; Brazil, India and China have come out of nowhere in the last year; China wasn't even in our top 50 last year for downloads, now they’re number 3, it’s like 900% growth and you know, we’re getting downloaded like roughly a hundred thousand times a month so it’s a huge number; so there’s this emerging market growth and we’ve been sort of fielding out what are people building in these emerging markets and it runs the gamut; like there are people building games, there are people building clones of popular services that you see that are mostly localized to the western world; and we’re also seeing apps that are really regional specific so like right down to micro payments to your local grocery store in Mexico for example; so that kind of thing.

So like web tech it’s like really runs the gamut but that trend is probably the most interesting one to me that we saw this big sort of corporate adoption and now we’re seeing this really big emerging market adoption; and it’s probably one of the bigger new challenges for us in the years to figure out how do we best facilitate this; when we first saw those stats we’re like wow, maybe we should translate to Chinese, Mandarin or whatever right like there’s a lot of stuff that we should be doing to help those developers; and we’re still learning what it means.

   

23. Do you see any trends for operating system adoption; I mean like Bada or all these other systems, are they more popular?

Well Bada is huge in Korea, probably has more adoption than Windows Phone just by its Korean --

Werner: Well that’s easy.

Yes, yes; true, it is easy; I mean iOS and Android are starting to dominate, I’m really hesitant to like pick any winners or choose any horses; so I mean iOS globally is still roughly 23% market share so it is not the dominant mobile platform that people make it out to be; and Android suffers its own issues; it’s definitely the dominant mobile platform but it just depends on which Android you’re talking about and --

Werner: …Android 2.1...

It’s 2.3 right now; 2.3 is probably the big boy and 2.3 is running not the greatest Webkit so yes, this is the issue; Blackberry 10, you know, remains to be seen what Microsoft Windows 8 is going to do but I think it could do well, definitely has a cool design; so it’s anybody’s game; the other – actually sort of leading back into the emerging markets thing, this sort of like dovetails nicely to Firefox OS; so the Firefox OS doesn’t have phones yet but it’s going to soon; we love it because it’s a PhoneGap like type approach but right from the operating system up built I think within a year; and instead of trying to pick a fight with iOS and Android, those guys the Mozilla Foundation has decided that they’re just going to go for the emerging markets and they’re starting with Brazil and Portuguese which is really interesting, there’s a lot of people there; it’s almost, you know, I think it will be 300 million people potential audience which is huge and that’s a great test bed for them to start their platform.

   

25. For Spain or is it Brazil?

Brazil, yes. That’s where they’re starting anyways and I know the Mozilla team has been flying back and forth from wherever they’re based down to Brazil to check it out and probably learning more Portuguese than they’ve ever learned before.

   

26. Right; so talking about Firefox OS, it’s all JavaScript, right?

Well it’s all JavaScript until you get to the C++. Which is like everywhere browser but yes, they’ve exposed back a pretty rich layer, much more comprehensive than what you see with PhoneGap; so they ran – when we built PhoneGap, it’s really just sort of a shim, right; it’s just sitting on top of what we can do; it’s embedded WebView and we’re really at the mercy of the proprietary platform that we’re running on or the mobile platform we’re running on; with Firefox OS they started right from the beginning and they ran into all kinds of interesting edge cases that we just never saw; so one example I like is resource locking; so resource locking is going to keep the screen on; now you could do this in Android and there’s ways to – funny enough sadly found a way to do it on iOS if you play a sound repeatedly you can keep the screen alive in a web view. So you just play a silent sound.

But that’s generally the use case you’re playing movies or games or you’re listening to music, you don’t want the screen to turn off and the sound to stop or the image to stop playing; so they created a web API for that in Firefox and they have other thing like ambient light, proximity, there’s just a whole slew of stuff that we kind of don’t get access to or we haven’t had the use cases to think about because the operating system is doing that stuff for us; so Firefox OS is really just like a blank slate web browser on top of a Linux kernel and you can do anything what the kernel can do; yes, it’s cool.

   

27. So I guess that’s the next big trend to check out, Firefox OS and I guess PhoneGap has a solution for Firefox OS as we discussed?

Yes, so we’ve prototyped the shim so your PhoneGap apps will run on Firefox OS and I imagine sometime in the coming year, we’re going to be support it with PhoneGap Build so you’ll just get sort of a transparent compile.

Werner: So let’s all check out Firefox OS and thank you, Brian.

Yes, cheers.

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT