Phonegap: Android: Training in Seattle, Wa Fil Maj Andrew Lunny
Phonegap: Android: Training in Seattle, Wa Fil Maj Andrew Lunny
Platform Overview
Open source, woo! Gaining momentum, fast. Fastest growing mobile platform in the world. 60,000 devices shipping per day. Java. . Dalvik VM. . Many versions -> fragmentation
Android Fragmentation
We have Android 1.5, 1.6, 2.0, 2.0.1, 2.1, 2.1-update1 more coming! Whats worse: the APIs keep on changing. Makes it difficult for PhoneGap to be completely and truly crossplatform:
In 2.0 we got HTML 5 support in the browser, to a degree. 2.0.1 adds to the supported HTML 5 features. 2.1 adds even more Joe Bowser, main developer of PhoneGap Android, talks about this on his blog: http://blogs.nitobi.com/joe/2009/11/20/androidsplintering/
How It Works
The browser on Android delivers our app.
You can instantiate a new browser instance (the class is called WebView) from Java. You can get it to load assets from within your app -> this is where your HTML/CSS/JS comes in.
The WebView also has an API and allows us to do some cool things with it:
We can enable JavaScript and (Android 2.0+) native HTML 5 geolocation. Android 2.0+ also allows us to mess with localStorage.
Once we call addJavascriptInterface, we can then access the Java functions present in the Java class from the JavaScript object we just bound the class to!
Application Deployment
Of all PhoneGap supported platforms, Android is by far the easiest to deal with when it comes to deployment and administration. No application reviews. nuf said. Cheap! Developer registration is $25 (compared to $100 for iPhone and $275+ for BlackBerry). Android Market is pretty rad, too, but needs to catch up to iPhone. 20,000 Android apps compared to 130,000+ iPhone apps.
Questions/Comments?