DevChatt 2011 - PhoneGap: For Fun and Science

download DevChatt 2011 - PhoneGap: For Fun and Science

If you can't read please download the document

Transcript of DevChatt 2011 - PhoneGap: For Fun and Science

PhoneGapFor fun and science

Cameron Kilgore @thrillgore ghostfreeman.net

I'm making the assumption that you already know what mobile applications are and you know why to support them. If you don't, too bad we don't have the time.

Hi, My name is Cameron, I am a web frontend developer who works out of Atlanta, and this is my second DevChatt conference. Today we're going to talk about mobile application development using the PhoneGap framework. We're going to cover a couple of things but segue into questions

What in the world is PhoneGap?

PhoneGap is a framework that uses web technologies such as HTML5, CSS3, and JavaScript to resolve the multi-platform mobile device conundrumIf you can make a web app, you can make a PhoneGap app

Developed & maintained by Nitobi, and available to the community at large as open source (MIT)

I think last year I said HTML5 was going to be big in the mobile spaces well, I'm sorta right

PhoneGap uses HTML5 to give us a foundation upon which we can build these rich mobile applications that we would need to use proprietary languages and toolkits to use

Simple rapid iteration and multi-platform support might be a reason companies like IGN, Logitech, Yamaha, and Ribot use PhoneGap for their mobile applications

How it's made (also a popular TV show)

PhoneGap uses JavaScript functions to access native interfaces on mobile devicesCamera

Accelerometer

Storage

Events

Etc...

Uses HTML5 semantic elements to implement context modes and interfaces from device to device

Extends HTML5 featureset in multiple devices

Basically, PhoneGap is a glorified WebView function. Without this centralized JS library that handles native calls to the device OS, I'd be speaking about the exciting world of FORTRAN

Many browsers (older Android phones) benefit from the addition of enhanced HTML5 features

Work the Shaft

PhoneGap's only performance gap is the performance of the rendering engineMobile rendering engines are faster than you think

Handsets are iterating quickly

Perfect for RAD and Agile development

HTML/CSS/JS is a framework we all know, so we don't need to learn Obj-C or Java to write applications

Every interface we need can be accessed using PhoneGap's JS callsSimilar to a JS library like jQuery, Dojo, Sencha

That's good old fashioned Misogyny

PhoneGap will not be the stop-gap for a real mobile applications but it is perfect for rapid application development.

We don't need to know new technologies if we use what we already know

You broke it, didn't you?

PhoneGap does not compile to native C like AppCelerator

While Apple recognizes that PhoneGap falls into acceptable terms, this could change

Performance is dependent on the rendering engine and JS interpreterAnd the OS

You open yourself up to internet browser vulnerabilitiesXSS attacks are possible

Booby trap the Stalemate button

PhoneGap is just a browser for local assets it does not include a full web server stackIf you want to make multi-page applications, you might have to work around that

You can extend functions with plugins

There are so many interfaces offered that I don't have time to cover them allBut if you want to do it, chances are you can with PhoneGap

You Mileage May Vary

PhoneGap works with:iOS (iPhone, iPod Touch, iPad)

Android

Symbian

Blackberry OS (OS 6+ and PlayBook)

WebOS

Windows Phone 7

Bada

MeeGo (status of MeeGo unknown)

Support varies from handset to handset, with Windows Phone 7 being the weakest due to its piss-poor rendering engine (IE7). But there is support

Bada is a mobile OS developed by Samsung, but no Bada devices are available in the US nor are there any immediate plans. Samsung seems to be releasing Android-only mobile devices here.

MeeGo support is there, but Mike is the only person here who cares about it and Nokia is going in a new direction...

PhoneGap does not work with NetFront, which is used on some Sony devices. Future devices (NGP handheld) will use WebKit but may not have a legal SDK.

Some perspective on mobile browsers

Mobile browsers...well, is a space in which WebKit has a solid grip (55.51%) over. With the exception of IE7 Mobile on Windows Phone 7, you will be developing with WebKit support in mind

This does not mean that WebKit support across mobile devices is universal (see quirksmode).

These statistics cover those collected by StatCounter and are not representative of real-world demographs.

Let's build an app

We're going to build a simple application that demos Accelerometer, Camera, and Location inside an Android 2.3 AVD ImageDue to move and short schedule I had to rebuff on more ambitious plans

To speed up time, we're also going to use jQuery Touch for our interface elementsjQuery Touch is another speech another time

MARTA was willing to give me access to the SOAP API that they allow Google and GDOT to access for course planning...after I applied for an IT Services contract. And closed the sources on my app. And agreed to a non-compete clause...

They also make all their aggregate data impossible to page scrape.

And now they're raising the fares for rail access incrementally by 22%.

Fuck MARTA. DC has the best Metro OF ALL TIME

Switch to Eclipse Here

Oh god how did this get here I am not good with computer

YES! CLASSIC INTERWEBS HUMOR

In Closing

PhoneGap isn't this cool, but it's close!

Any Questions?

Thanks for comingSource code + slides will be up soon@thrillgore

I also want to thank Medium and the people who worked there for helping put this together. I'm saddened to hear all the bad news, and I wish you all the best.

Muokkaa otsikon tekstimuotoa napsauttamalla

Muokkaa jsennyksen tekstimuotoa napsauttamallaToinen jsennystasoKolmas jsennystasoNeljs jsennystasoViides jsennystasoKuudes jsennystasoSeitsems jsennystasoKahdeksas jsennystasoYhdekss jsennystaso

Muokkaa otsikon tekstimuotoa napsauttamalla

Muokkaa jsennyksen tekstimuotoa napsauttamallaToinen jsennystasoKolmas jsennystasoNeljs jsennystasoViides jsennystasoKuudes jsennystasoSeitsems jsennystasoKahdeksas jsennystasoYhdekss jsennystaso

Muokkaa otsikon tekstimuotoa napsauttamalla

Muokkaa jsennyksen tekstimuotoa napsauttamallaToinen jsennystasoKolmas jsennystasoNeljs jsennystasoViides jsennystasoKuudes jsennystasoSeitsems jsennystasoKahdeksas jsennystasoYhdekss jsennystaso

Muokkaa otsikon tekstimuotoa napsauttamalla

Muokkaa jsennyksen tekstimuotoa napsauttamallaToinen jsennystasoKolmas jsennystasoNeljs jsennystasoViides jsennystasoKuudes jsennystasoSeitsems jsennystasoKahdeksas jsennystasoYhdekss jsennystaso

Muokkaa otsikon tekstimuotoa napsauttamalla

Muokkaa jsennyksen tekstimuotoa napsauttamallaToinen jsennystasoKolmas jsennystasoNeljs jsennystasoViides jsennystasoKuudes jsennystasoSeitsems jsennystasoKahdeksas jsennystasoYhdekss jsennystaso

Muokkaa otsikon tekstimuotoa napsauttamalla

Muokkaa jsennyksen tekstimuotoa napsauttamallaToinen jsennystasoKolmas jsennystasoNeljs jsennystasoViides jsennystasoKuudes jsennystasoSeitsems jsennystasoKahdeksas jsennystasoYhdekss jsennystaso

Mobile web browsers by rendering engineStatCounter, 2011 MarchPercentage

WebKit (iOS, Android, Symbian, MeeGo, WebOS)55.51

Opera Mini21.81

Blackberry OS12.76

Other9.92