Apple's iPhone development kit rocks

Tom Yager is impressed

Eight months ago, Apple was a non-player in the mobile space. Now, according to Apple, iPhone is the second most popular smartphone solution after BlackBerry. With all the hoopla he raised over iPhone at launch time, it's as if Steve Jobs saw this coming. What he admits he didn't see coming was the market's reaction to the lack of a software development kit (SDK) that would support third-party apps on iPhone. iPhone is the only smartphone platform without custom application support, and that fact locked Apple out of the fleet sales that are RIM's bread and butter. It also disenfranchised the Mac developers who put Mac on the map and keep it there with, wouldn't you know it, native applications. I have weighed in on the subject of an iPhone SDK for native software in my usual soft-spoken, dead-horse-friendly way. "Apple, don't brag that iPhone runs OS X," I said, "until developers can get at it." Come June, Apple gets a pass to brag about its mobile OS all it likes. That's when Apple is slated to deliver its SDK for iPhone, and from the work I'm doing with the publicly available preview tools and documentation, I can attest that iPhone will be the simplest, best-documented and most enjoyable experience for mobile application developers. I have coded fairly extensively with Symbian, Windows Mobile and BlackBerry. iPhone just blows them away, making me wonder who decided that mobile development had to be difficult. I'll take that a step further: If you're new to programming, iPhone or iPod Touch is a splendid place to start. I can't do the iPhone SDK justice in one post, but I can hit a couple of the high notes that earn Apple props for taking the SDK further than it had to. For openers, application developers don't need to use Objective-C, C or C++ to write software for iPhone. Apple added the one thing I was sure it wouldn't add — data persistence — to iPhone's Safari browser, paving the way for applications crafted in JavaScript, HTML and CSS that run even when the network is unavailable. What's more, iPhone's JavaScript persistence doesn't force programmers to deal with flat text files or XML. It uses SQL, complete with transactions. Apple also put some flash (ahem) in Safari's GUI with built-in support for Scalable Vector Graphics (SVG) and both automatic and explicit animation. Apple supplies web app code snippets that mimic iPhone's native GUI, and a web application can take over the whole screen, leaving no trace that it's running in the browser. iPhone's offline web app support is so strong that I'm looking forward to seeing it ported to Safari for the desktop. On the native side, we now know that the iPhone OS is based on OS X 10.5, aka Leopard, and that Apple has catered to Mac developers. Their skills, and fair chunks of their code, will move readily to iPhone. In fact, there are so many similarities between the Mac and iPhone that much of learning to code for iPhone is familiarising yourself with what you can't do. For example, the same presentation facilities, such as OpenGL and Quartz, are present in desktop and iPhone OS X, but OpenGL is slimmed down to OpenGL ES (embedded systems), and Quartz is limited to 2D graphics. But use the word "limited" carefully where the iPhone SDK is concerned. Quartz may be limited to 2-D, but it can still load, display, scale, annotate, and save PDF files. Can your phone or music player do that? Native iPhone applications have access to standard POSIX C APIs and other must-haves such as Berkeley Sockets for TCP/IP communication. All third-party code runs in a sandbox, meaning that the OS exerts tight control over its access to system calls, TCP ports, files and other resources. You can't write an application that dips into another app's files. You can't write a custom mail or Telnet server that listens on the standard TCP ports for these services, whether the iPhone OS is using those ports or not. Of course, there's no path from the sandbox to any device internals that you could use to flip the phone to a different wireless operator. The sandbox is tight enough that a hacker would have to punch through it to pillage or hobble your iPhone, and Apple has set it up so that every application can be traced back to its creator. Apple's method for registering and certifying applications will engender controversy, but users need to know that they can sample the riches of iPhone software in complete safety. I'll leave you with two details that put iPhone way over the top for developers: namely, the multitouch display and the three-axis accelerometer. Both of these are accessible in native code as well as JavaScript. Complex multitouch gestures such as pinch, spread, sweep and circle are sent to software as events along with the basic tap and drag. To make the on-screen keyboard appear, you don't ask for it. You simply move the focus to a text field. The accelerometer is developer candy that will break Apple into the gaming market in a way that the Mac never could. iPhone can sense orientation and movement in 3D space. As you move, or whatever is carrying your iPhone or iPod Touch moves, an application can know about it. The possibilities are endless, and there are serious uses for 3D position sensing that can't be set aside. It's an ultimately intuitive controller for complex processes that currently require operators to bypass humans' natural 3D perception in favour of 2D controls such as buttons, switches, mice and joysticks. It's my job to dream big, but developers will come up with far more down-to-earth uses for iPhone and iPod Touch. Apple's main interest is in opening iPhone to enterprises that demand mobile devices they can customise to suit their needs. The SDK gets Apple there, and Apple's Mac-like approach stuffs the market with thousands of developers ready to code for the phone. Those enterprises in need of custom code for fleet-issued handsets don't have to look very far for talent. By year's end, there will be a glut of great software for iPhone and iPod Touch, much of which will cost nothing. And to top it off, Apple will host the entire catalogue of third-party software.

Join the newsletter!

Error: Please check your email address.

Tags technologyAppleiPhonesoftware development kit

Show Comments
[]