back
▲ 40 points

Native vs Html5 Mobile Applications

deck.cc
by tosh·16y ago·9 comments·view on hn ↗
It seems like everyone is doing native apps now. Many people I know ponder about whether to learn Objective-C on the one hand or dive into the Android platform on the other hand.

A tough choice as both of them already gained a significant smartphone market share and are growing fast. Clients actually demand native apps even while most of them could easily be implemented using html5.

9 comments
The problem I have with offline HTML5 applications, on the iPhone at least, is that when your phone thinks it is on the internet because AT&T is servicing it with 4 bars, but only providing a few dozen bits per second of effective bandwidth.

So your user decides to run your application and touches the icon on the home screen ("not a desktop").

• Your application launches and displays your splash screen instantly. (Everything from here out is your fault in the user's eyes.)

• Safari decides to use HTTP to verify the manifest file and see how things are. It also, perversely, does a query to load the splash screen that is already showing.

• Now your user stares at the splash screen for 60 seconds wondering what kind of an idiot you are and how badly you must hate him while AT&T shifts a couple thousand bits of manifest response to you in their most profit enhancing manner.

This can be mitigated by pushing cache times up, but you either push them to infinity and explicitly change URLs to catch updates or roll dice with your user's experience.

I'd put a release number in the URL, set the expirations to doomsday, and bump the release number for each update, but the URL of the first page loaded in the app is fixed when the user bookmarks it onto the desktop.

What about geolocation or using the phone's built-in camera, is/will this at all be possible from HTML5 apps?

Those features are a huge incentive to create mobile apps, imo.

There is a geolocation API that falls under the extended "HTML5" family of technologies. It's implemented in MobileSafari, don't know about Android or WinMo.
I can recommend geo.js http://code.google.com/p/geo-location-javascript/

It supports several devices like:

iPhone OS 3.x, Browsers with Google Gears support (Android, Windows Mobile), Blackberry Devices (8820, 9000,...), Nokia Web Run-Time (Nokia N97,...), webOS Application Platform (Palm Pre), Torch Mobile Iris Browser, Mozilla Geode,

It is possible with Android too, even the Camera works on Froyo.
At the Google I/O 2010 keynote, day 2, they said that camera and magnetometer support in the browser will be integrated in the next release (gingerbread?). What they show was "a sneak peak of what coming next, after froyo".
Really? I'd heard that wasn't planned until the next release of Android.
geolocation is possible with html5, built-in camera is possible on Android but not for streaming. This is coming though to html5 with the device API.
SproutCore Touch has native support for complex HTML5 apps and takes advantage of hardware-accelerated graphics. Try touch.sproutcore.com and touch.sproutcore.com/hedwig on an iPad.