Sunday, June 12, 2011

iPhone development part 1

Let’s take a detailed took at the landscape for iPhone development, enumerating the different ways to build iPhone Apps and also the tools available to help in the same. iPhone is the biggest thing to happen to the mobile world in real times. The amazing screen and other browsing features has made the Apple iPhone the most popular web browsing mobile device. The same features have also resulted in developers salivating over an opportunity to create iPhone Apps. We first discuss the two fundamental ways to build iPhone Apps and point you to important resources which will help you get started on them as soon as possible.

Basically there can be two different ways that you can write applications for the iPhone:
1. Web Applications (work via browser & networks)
2. Applications (phone based can be network independent for our current understanding)

Web Applications are applications that run of the Safari browser on the iPhone. These applications are typically web applications with their interface and layout customized to suit the browsing communications that have emerged for the iPhone.

I use the word “communication” s specifically to emphasize the fact that web applications need to not only change the layout and appearance to suit the iPhone, but also at the same time rethink usability (not design) to suit the new browsing patterns that have come with the iPhone.

Let’s discuss more on these “Web Applications”

As previously mentioned iPhone Web applications are essentially web applications which run of the Safari browser on the iPhone. The major difference from native web applications is that they cannot access the hardware features like accelerometer, file system etc. They are constrained to run in the sandbox of the browser which is similar to other web applications.

The easiest way to build iPhone web applications is to take your existing web applications and fix the layout so that they match the layout guidelines on the iPhone. The biggest change that this would require is to reduce your real estate to match the size of the iPhone. Also the navigation and usability needs to be changed to better suit the iPhone usability idioms.

The biggest usability change that can be seen in iPhone web applications is the streamlining and extreme focus that it has bought to existing web applications. Instead of the typical web pages which are crammed with content, navigation, lists, advertisements, promotions in every nook and corner, iPhone web applications need to be extremely streamlined and focussed in their approach.

This streamlining and focus is achieved with categorizing every page into only two different kind of layouts. These layouts are firstly a list based layout and secondly an action based layout. What this means that any existing web application need to be broken down into independent screens, each of which need to be either a list based screen or a single action based screen. This is apart from the additional navigation which can be provided in the form of a Next/Previous buttons in the top bar or a tab based navigation.

There are already a lot of tools which help you convert your existing web applications into iPhone applications. Below we mention two of them which probably might be the only thing you need to build iPhone web applications.

Applications are applications that are run on the iPhone itself. These applications are developed largely in Objective-C (a variant of the popular C language) and use the iPhone specific features which are exposed using the Cocoa API on the iPhone.

Obviously, as native applications run directly on the iPhone they have much better access to the iPhone hardware and can use them effectively. And exclusively the iPhone hardware dependant.

Phone applications are applications which run directly on the iPhone hardware. These applications can take advantage of the wide range of hardware innovations that come with the iPhone. These include support for multi-touch, hand gestures, iPhone camera, accelerometer and the built in GPS.

However phone applications are much harder to build as compared the web applications. And if you are not too much into programming the complex syntax of Objective-C will present to you a very steep learning curve. On the plus side, those who have scaled this curve can use their programming chops to cook up some of the most innovative applications that are getting enabled by the iPhone. Add to that the instant recognition and money that a lot of developers have earned by listing on the iPhone App store, and that should be motivation enough for you to start hacking right now.

Native applications unfortunately require you to invest in Apple hardware if you don't already have some. At the minimum you would need a Mac because the iPhone SDK currently only runs on one. Secondly, you would need an actual iPhone. Even though the SDK comes built in with an iPhone simulator this is not enough because a lot of features don't run the same as on an actual iPhone. Case in point is the accelerometer and multi-touch support both of which are not supported on the emulator.

There essentially two big pieces of technology you need to master to build iPhone native applications: Cocoa and Objective-C.

Cocoa is the platform and the API that iPhone exposes for you to access the low level iPhone functionality. Apart from this Cocoa also provides the infrastructure to build simple form based applications for the iPhone. As Apple provides exhaustive documentation on the Cocoa API it is pretty straightforward to get started on.

Objective-C is the variant of the popular C language which is used for the iPhone development. Objective-C is pretty much the same as C/C++ apart from the way it structure functions and message passing. Message Passing, or the way Objective-C structures functions calls are a much more object oriented way of programming, however the syntax takes some time to getting used to. Apart from Cocoa and Objective-C in case your native application is graphics heavy (for example games) it might need to use Open GL to build the graphics part. Open GL is an open source graphics library and is supported on the iPhone.

I believe this is more than required for theory now lets dwell more on how to implement this. So next step we will understand about creating a simple iPhone / iOS application.

2 comments:

  1. This information is simply superb. The way Ravi has explained the development methodology explains need to understand this new technology. Now Tablet PCs coming up in the market future Software Development surely is going to revolve around this technology and terminology for at least next 10 Years.

    --- Sachin Deshpande, PMP

    ReplyDelete
  2. Wow This is great Start Sir, waiting for more, Thanks a million for this new avenues & vision
    Raj

    ReplyDelete