views:

512

answers:

4

I am trying to get an overview of what kind of native iPhone features I can get access to when I write a Web App (using html/css/javascript, running in Safari).

Meaning: I like to know whether I can get access to features specific to "smartphones" in general and iPhone/iTouch in particular (accelerometer, address book, photo library, the iPhone's unique identifier, camera, compass, available Wifi networks, etc.).

I suppose there must be an overview somewhere, probably on the Apple developer site, but I have trouble finding it, because it's all about native apps now.

+2  A: 

PhoneGap is not the solution you were looking for, but might be interesting for any web developer, planning apps for smart phones.

Kai
Thanks for the note. I already had a look at it, and it's not a bad way to look at what's doable (and how), however it aims rather at a common denominator over all smartphones than to suit all iPhone capabilities.
Thomas Tempelmann
I think phonegap handles any iphone function you might need. I could be mistaken though...
Neo42
+2  A: 

You may want to check out iwebkit, it offers some optimizations that may come in handy when developing iPhone web apps. Also, the community there may be able to help you out in regard with what features you can use.

luvieere
iWebKit was new to me (or maybe I knew of it long ago but forgot). Thanks for the link.
Thomas Tempelmann
+3  A: 

Check out "iPhone Human Interface Guidelines for Web Applications" on Apple developer site.

It does not say so explicitly, but based on what it talks and does not talk about, looks like you can NOT get access to any of the advanced iPhone capabilities that you mention. So, iPhone web apps are basically just web pages that may have an optimized user experience for the iPhone (the above guide has good specific instructions for optimizing the experience).

The only exception seems to be geolocation that seems to be accessible from within the web apps. But this is not because MobileSafari is doing something special about the iPhone; it is simply because the geolocation API is (going to be) part of web standards, and MobileSafari just implements the standard.

Added: looks like you also get a notification when iPhone orientation changes, see the comment below about onorientationchange event.

Jaanus
You appear to be right on it, unfortunately.
Thomas Tempelmann
+2  A: 

There is very little you get access to besides what is normally available in a browser. There is an event hook for when the screen orientation changes (onorientationchange), and that's about it.

jarcoal