On 2009-09-13, at 10:43 AM, Justus wrote:
I agree about the cutting corners part, but "better and finally
easier" is all relative.
You can still cut corners when developing natively. I wouldn't blame a
hammer or screwdriver for a carpenter not building a house properly
that is not up to code (pun intended). One could buy a fancy kitchen
knife (or a SlapChop - I had to get a reference to that in somehow!)
but making gourmet dishes takes lots of experience. Everyone has to
start somewhere, and for a lot of people this is through web
technologies. Sure some apps are crappy, but these will be weeded out
eventually through rankings.
The goal for PhoneGap is for it not to exist -- so that the OS itself
eventually provides a javascript interface to their frameworks (which
Nokia with WRT and Palm with WebOS is already doing). Scripting to
native is not without precedent on the Apple platform - with Leopard,
Apple provided a scripting bridge (http://
bridgesupport.macosforge.org/) for users to write Cocoa applications
using for example Ruby and Python (through RubyCocoa and PyObjC).
In fact, Apple has crippled the WebKit provided in UIWebView so that
native objects could not be bound to Javascript.
As an Objective-C developer, I was a vendor that helped develop a
desktop app for a Fortune-500 company, that is installed on millions
of computers that was developed almost entirely using javascript+html
+css (with an Objective-C back-end, much like PhoneGap). Through
meticulous testing, performance and pixel-perfect detail of the UI,
the app looks pretty much like any other native app (the reasons for
going non-native were both strategic and experimental, which seems
prescient with all this ChromeOS talk). To the user, they don't care
what tech is going on under the hood.
Apple, with ITunes 9, is using their own new TuneKit: "The new iTunes
interactive media content formats are built using open web standards:
HTML, CSS, and JavaScript, using a new framework Apple calls
TuneKit" (see http://www.appleinsider.com/articles/09/09/14/apples_tunekit_itunes_lp_format_appears_aimed_at_apple_tv.html
). For their MobileMe web interface, they are using SproutCore, a JS
framework - which provides a desktop-like interface.
With SVG, Canvas plus javascript (all supported in the UIWebView -
plus major browsers, except that one), one can build amazing
interfaces if one wanted to take the time. Not to mention the goodies
available in HTML 5.
Have I gone off topic yet? :P
Yes if Apple wanted to encourage iPhone development with scripted web
languages they could simply add a layer and hooks to allow all of this
using Dashcode alone. I doubt they will do this-> however.
There is no sneaky hack happening. We are using the same way Apple
recommends(!) how to talk from Javascript to Objective-C. I was at
WWDC 2009 and they demonstrated this very fact in a talk, which is
exactly how PhoneGap does this (through
UIWebView::shouldStartLoadWithRequest and special gap:// urls).
PhoneGap apps being rejected are because of an unfounded assumption on
Apple's part (that PhoneGap is an external framework, uses
undocumented APIs etc). Through Nachoman's interaction with them, the
true nature of PhoneGap has been communicated and the result is recent
PhoneGap apps have been approved.
I assume to go the other direction you use
stringByEvaluatingJavaScriptFromString?
I wasn't aware of the Nachoman communication with Apple....is that
covered somewhere on this list, or elsewhere? Are you confident that
the rejection issue is now settled, and that Justus' concerns are no
longer relevant?