Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is very misleading. It should really be called 'Building web applications with limited access to the iPhone APIs that somewhat look like native iPhone applications' :-)

There are a bunch of frameworks that take the html/css/javascript approach. You can do a lot this way but what nobody really seems to get is that your app will run in a WebView that is basically sandboxed with very limited access to iPhone APIs.

The APIs that you are allowed to use are those that Apple hyped when they came out with the iPhone OS 1.0. Basic Javascript hooks to access the address book, accelerometer, maps, camera, etc.

There is no way to access more native functionality.

I was at a conference last month (FITC Mobile) where this approach was also demonstrated. The speaker put together a simple app to take a picture with the camera and then upload it to Twitter. It looked like sh*t (because it is a web app and not a native iPhone app) and it was also not able to things that required native API access like scaling the image down. (Two lines of code in ObjC)



WebKit can easily scale an image down using the canvas element. Native UI can also be replicated pretty much perfectly in WebKit (e.g. you might be surprised to learn that iTunes and the app store are displayed with WebKit). Sounds like the speaker just didn't do a very good job.

The only things that aren't suitable for WebKit are things that require heavy CPU usage or access to iPhone features that Apple hasn't made available to WebKit yet, like OpenGL (incidentally, WebGL has recently landed in WebKit, so OpenGL access will no longer be a problem).


I was talking about taking an image from the camera, scaling it down and then uploading it as an PNG. How would you do this from within a webview?


Scaling, converting to a PNG, and uploading the resulting image is trivial in WebKit. As for accessing the camera hardware to take a picture, that requires an API from Apple, which I thought you implied existed. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: