Chapter 1. Introducing the iPhone and iPad

This chapter covers

  • Understanding Apple’s iPhone and iPad technology
  • Examining the iPhone and iPad specifications
  • Highlighting what makes the iPhone and iPad unique

There is no doubt that Apple has completely altered the mobile computing paradigm with its introduction of the iPhone and iPad. A sleek touchscreen interface almost completely devoid of actual buttons physically changed how we interact with our mobile devices. Fluid and dynamic, this screen can represent almost any two-dimensional interface imaginable. This alone might have blown away several previous generations of clunky, incrementally changing smartphone and netbook interfaces. But Apple’s insight into opening up the iPhone OS early on as a platform for an army of independent developers (just like you), who could quickly produce thousands of apps, allowed consumers to customize and personalize their phones, transforming them into something more transcendent and utilitarian than just a phone with some hasty, ill-conceived, add-on applications. The iPhone became a personal computer you can carry in your pocket.

The iPad, in contrast, is more of an expansion of the iPod Touch than a bigger, sleeker iPhone without the phone. It straddles the market between the iPhone’s handy pocket size and larger, traditional netbooks; and at the same time, it takes aim at more recent ebook readers.

1.1. A bit of history

In 2006, rumors and speculation rumbled across the internet concerning Apple’s next major innovation: an iPod-like mobile phone that would eventually be called the iPhone. Given Apple’s twenty-first century record of technological innovation and superb user design, the iPhone offered a new hope and promised a new look at the entire cellular phone industry and the possibility of improved technology that wouldn’t be afraid to strike out in bold new directions.

Apple acknowledged that it was working on an iPhone in early 2007. When the company previewed its technology, it became increasingly obvious that the iPhone would be something new and different. Excitement grew at a fever pitch. On the release date—June 29, 2007—people camped outside Apple stores. Huge lines stretched throughout the day as people competed to be among the first to own what can only be called a smarterphone, the first of a new generation of user-friendly mobile technology.

When users began to try out their new iPhones, the excitement only mounted. The iPhone was easy to use and provided numerous bells and whistles, from stock and weather reports to always-on internet access. Sales reflected the frenzied interest. Apple sold 270,000 iPhones in 2 days and topped a million units in just a month and a half. Interest in the iPhone continued to grow. Apple’s July 11, 2008, release of the new 3G iPhone and its public deployment of the iPhone software development kit (SDK) multiplied the iPhone’s success into the future. The 3G managed to hit a million units sold in 3 days. We’re atop a new technological wave, and it has yet to crest.

After the release of the iPhone, some time passed, and rumors spread that Apple was working on a new device. It was said to be some sort of multitouch tablet. In January 2010, these rumors were confirmed when Steve Jobs announced the iPad. Jobs was excited about the iPad and was quoted as saying, “Our most advanced technology in a magical and revolutionary device at an unbelievable price.” In April 2010, the iPad was released in the U.S. Apple sold around 300,000 iPads on the first day. Compare that to 270,000 original iPhones, and it’s apparent that the iPad was received very well.

1.2. All for one and one for all: the iPhone OS platform

The iPod Touch, iPhone, and iPad (and likely future generations of Apple devices) all use the iPhone OS. The iPhone moniker may be a bit confusing at first, but having one OS for all these devices makes it an easy and rewarding platform on which to develop. Learn how to develop for it once using the iPhone OS SDK, and you can adapt your applications to whichever devices you like.

As the iPad approached its release date, many developers were able to capitalize on their experience creating apps for the iPhone and release iPad apps on the very day the iPad was first available. This was certainly an additional incentive for consumers to purchase the iPad.

There are differences in developing applications for the iPad as opposed to the iPhone, but they’re primarily related to the different amount of real estate available to each device, as illustrated in figure 1.1. For the most part, you can run the examples in this book on either the iPad or the iPhone with little adaptation (see appendix D for information about how to adapt iPhone apps into iPad apps).

Figure 1.1. The iPad and iPhone compared side by side. The primary difference between the two—the available screen real estate—is readily apparent.

1.3. Core hardware specifications

Apple releases new versions of its mobile devices on a more-or-less yearly schedule. In those releases, Apple offers different models at different price ranges targeting a large spectrum of consumers. After only a few years, a bevy of different models are out in the marketplace. Let’s look at them.

1.3.1. The iPhone

The iPhone exists in three different versions: the 2007 original release, the 2008 3G release, and the 2009 3GS. Each is a 4.7- or 4.8-ounce computing device. Each contains a 620 MHz ARM CPU that has been underclocked to improve battery performance and reduce heat. The iPhone and iPhone 3G each include 128 MB of dynamic RAM (DRAM) and from 4 to 16 GB of Flash memory. The 3GS received an upgrade to 256 MB of RAM as well as a graphics chip enabling it to run OpenGL ES 2.0.

Programmatically, the iPhone OS is built on Apple’s OS X, which is itself built on top of UNIX. Xcode, the same development environment that’s used to write code for the Macintosh, is the core of native programming for the device. Putting these two elements together reveals a mature development and runtime environment.

1.3.2. The iPad

Almost one year after the release of the iPhone 3GS, Apple released the iPad. The iPad is a sort of hybrid device that isn’t quite a laptop, but isn’t quite a phone. Apple touts it as somewhere in the middle. Many argue that tablet devices are the future of mobile computing and that the iPad has set the stage.

The iPad weighs in at 1.5 pounds for the wi-fi model and 1.6 pounds for the wi-fi+3G model. Its 9.7-inch LED screen supports a resolution of 1024 x 768 at 132 pixels per inch. The iPad comes in 16 GB, 32 GB, and 64 GB models, all equipped with a 1 GHz A4 custom designed CPU.

The iPad’s OS is almost identical to that of the iPhone and iPod Touch, with some enhancements and updates to support the larger screen as shown in figure 1.2. One of the major enhancements is that there is no wrong way to hold the device. This means it supports all orientations and can be held in portrait or landscape mode, and the software automatically adjusts itself.

Figure 1.2. iPad screen area compared to iPhone screen area. Native iPhone apps that aren’t upgraded to run on the iPad appear in the center of the iPad screen.

1.3.3. The iPod Touch

A few months after the release of the original iPhone, Apple updated its iPod line with the iPod Touch. This was a new iPod version built on iPhone technology. Like the iPhone, it uses a 480 x 320 multitouch screen and supports a mobile variant of Safari.

But the iPod Touch is not a phone. The original version didn’t have any telephonic apparatus, nor did it include other iPhone features such as a camera. Because of its lack of cellular connectivity, the iPod Touch can only access the internet through local-area wireless connections. The year 2008 saw the release of a new version of the iPod Touch that included an external speaker and volume controls missing from the original 2007 model.

The developer advice in this book largely applies to the iPod Touch, although we won’t specifically refer to that device.

1.3.4. iPhone and iPad input and output specifications

The general specs we’ve just described tell only part of the story. By looking deeper into the iPhone’s and iPad’s input and output, network, and other capabilities, you’ll discover what makes them truly innovative computing platforms. The input and output capabilities of the iPhone and iPad feature cutting-edge functionality that determines how developers program for the platform. Input is conducted through a multitouch-capable capacitive touchscreen. There’s no need for a stylus or other tool. Instead, a user literally taps the screen with one or more fingers.

The iPhone’s visual output is centered on a 3.5” 480 x 320 pixel screen. That’s a larger screen than has been seen on most cell phones to date, a fact that makes the iPhone’s small overall size that much more surprising. The device is literally almost all screen. The iPhone can be flipped to display either in portrait or landscape mode, meaning that it can offer either a 480-pixel-wide or a 480-pixel-tall screen. The iPad has much larger resolution, measuring 1024 pixels tall by 768 pixels wide.

iPhone and iPad output also supports a variety of media, all at the high level you’d expect from the designers of the iPod. Music is supported in a number of formats—including Advanced Audio Coding (AAC), Audio Interchange File Format (AIFF), Apple Lossless, Audible, MP3, and WAV—as well as MPEG-4 videos. Generally, the iPhone and iPad deliver CD-quality audio and high-frame-rate video.

Although users will load most of their audio and video straight from their computers, the iPhone and iPad can play streams at a recommended 900 Kbps over wi-fi; but that can be pushed much higher on a good network. Multiple streaming rates always choose the optimal method for the current network interface—which brings us to the question of the networking capabilities of these devices.

1.3.5. iPhone and iPad network specifications

Apple offers two methods of wireless network connectivity for the iPhone and iPad: local area and wide area.

The preferred method of connectivity is through a local-area wireless network, using the 802.11g (n for the 3G models and iPad) protocol to link up to any nearby wifi network (provided you have the permissions to do so). This can provide local connections at high speeds of up to 54 megabits per second (Mbps), thus making a network’s link to the internet the most likely source of speed limits, not the device itself. Everything has been done to make local-area connectivity as simple to use as possible. Passwords and other connection details are saved on the device, which automatically reconnects to a known network whenever it can. Switches to and from local wi-fi networks are largely transparent and can happen in the middle of internet sessions.

The original iPhone uses the EDGE network for wide-area wireless connectivity, falling back on this network whenever local-area wireless access isn’t available. The EDGE network supports speeds up to 220 kilobits per second (Kbps). Compared to old-style modems, which accessed the early internet just 15 years ago, this is fast; but compared to broadband connectivity, it’s not that good. Although the original iPhones have already been phased out, millions of users are still using them, and thus EDGE network speed remains relevant.

The 3G and 3GS iPhones support the third generation of mobile phone standards, which are well developed in Europe but just emerging in the United States. Network speed standards for 3G are loose, with stationary transfer speeds estimated as low as 384 Kbps or as high as several Mbps. A 3G connection should generally be noticeably quicker than EDGE but still not as fast as a local-area network. In addition, 3G iPhones may drop back to EDGE connectivity if there’s insufficient 3G coverage in an area. Table 1.1 lays out the network capabilities of each device.

Table 1.1. Supported network types for Apple devices

Device

EDGE

3G

Wi-fi

Original iPhone  
iPhone 3G
iPhone 3GS
iPod Touch    
iPad wi-fi model    
iPad 3G  

When you’re developing applications that take advantage of web capabilities, it’s always important to consider the limitations of the device you’re targeting.

1.3.6. iPhone OS browser specifications

The iPhone and iPad browser is a mobile version of Apple’s Safari, shown in figure 1.3. The browser is a core part of iPhone and iPad functionality, bringing the internet to the fingertips of the user virtually anytime, anywhere, largely without the constraints of traditional mobile browsing. It’s a full-fledged desktop-grade browser with access to DOM, CSS, and JavaScript. But it doesn’t have access to some client-side third-party software that you may consider vital to a web page’s display.

Figure 1.3. This book’s webpage as shown in Mobile Safari on the iPad. The simplified navigation maximizes the usable viewing area.

The two most-used third-party software packages that aren’t available natively to the iPhone and iPad are Flash and Java. There was some discussion of a Java release in 2008, but the SDK’s restriction against downloads seems to have put that effort on hold.

Beyond listing what’s available for the Safari browser (and what’s not), we’ll also note that it works in some unique ways. Numerous small changes optimize Safari for the iPhone or iPad. For example, rather than Safari’s standard tabbed browsing, individual tabs appear as separate windows that a user can move between as if they were individual pages.

This version of Safari also features unique chrome, which is its rendition of toolbars. These gray bars appear at the top and bottom of every web screen. The chrome at the top of each page shows the current URL and features icons for bookmarks and reloading.

Compared to their previous-generation competitors, the iPhone and iPad produce an internet experience that is more usable, better integrated, and more constant than the standard mobile experience.

The improvements in usability stem from the innovative specifications that you’ve already seen. On the input side, you no longer have to use a scrolling wheel to painfully pick your way through links up and down a page. On the output side, pages are displayed cleanly and crisply without being broken into segments, allowing for a faster, more pleasant web experience. For networking, you have the relatively good speed of the EDGE or 3G network combined with the ability to use lightning-fast local-area networks whenever possible. Compared to previous-generation phones plagued by molasses-like internet connections, the change is striking.

The iPhone includes a variety of standard programs such as a YouTube interface, a stock program, a maps program, and a weather program, all of which provide seamless, automatic access to the internet. The iPad is a little less fully outfitted out of the box, but its needs are less defined—it’s more of a blank slate than the iPhone. The iPhone SDK provides simple access to the internet for original applications.

All this functionality is supported by a constancy of internet access that is unlike anything the smartphone or netbook industry has seen before. Supplementing its wi-fi access, an iPhone can access the internet through cheap add-on data plans, which will soon be available for the iPad as well. These plans allow for unlimited data transfer via the web and email. Thus, users never have to think about the cost of browsing the web (although the hidden cost has been frequent dropped calls on high-traffic, overburdened networks in urban areas with high iPhone saturation). Now the internet is always on and always available—and that, as you’ll see, is another element that makes the iPhone and iPad unique.

1.3.7. Mobile web standards

Prior to the release of the iPhone, a number of web standards were being developed for smartphones. The .mobi top-level domain was launched in 2006, built on the Wireless Application Protocol (WAP) and the Wireless Markup Language (WML) standard for cut-down, mobile HTML. In addition, the W3C Mobile Web Initiative has begun work on standards such as mobileOK (which is meant to highlight mobile best practices).

It’s our belief that the mobile standards—and even the .mobi domain—are for the most part irrelevant when applied to the iPhone. We believe this because the iPhone provides a fully featured desktop-class browser and has vastly improved input, output, and networking capabilities. There are best practices for developing on the iPhone and iPad, and we’ll talk about some of them in upcoming chapters, but they’re not the same best practices required for leading-edge designs prior to 2007. As more smarterphones appear, we believe that the mobile standards being worked on now will quickly become obsolete.

This isn’t to say that the iPhone and iPad are without limitations. They don’t and can’t provide the same experience as a desktop display, a keyboard, and a mouse. New mobile standards will exist, but they’ll be different from those developed today.

Having discussed the general capabilities of the iPhone and iPad—their input, their output, their network, and their browser—we’ve hit all the major elements. But these devices also have some additional hardware features that are worthy of specific note.

1.3.8. Other hardware features

Cell phones feature numerous hardware gadgets, of which a camera is the most ubiquitous. The iPhone includes all the cell phone standards but also some neat new elements, as outlined in table 1.2. The iPad is a little less gadget packed, but that may change in the future.

Table 1.2. The iPhone and iPad are full of gadgets, some of them pretty standard but others more unique.

Gadget

Device

Notes

Accelerometers iPhone, iPad The iPhone and iPad contain three accelerometers. Their prime use is to detect an orientation change with relation to gravity—which is to say they sense when the device is rotated from portrait to landscape mode or back. They can also be used to approximately map the device’s movement through three-dimensional space.
Bluetooth iPhone, iPad This standard protocol for modern cell phones allows access to wireless devices. The iPhone and iPad use the Bluetooth 2.0+EDR protocol. Enhanced Data Rate (EDR) allows for a transmission rate about triple that of older versions of Bluetooth (allowing for a 3.0 Mbps signaling rate and a practical data transfer rate of 2.1 Mbps).
Camera iPhone This is another de facto requirement for a modern cell phone. The original iPhone and the iPhone 3G have a 2.0 megapixel camera, and the 3GS ships with a 3.0 megapixel camera. As of its first-generation release, the iPad doesn’t have a camera.
Video camera iPhone 3GS A video camera was introduced with the iPhone 3GS.
GPS iPhone 3G The original iPhone doesn’t support real GPS but instead offers the next best thing: peer-to-peer location detection. This faux GPS triangulates based on the relative locations of cell phone towers and wi-fi networks for which real GPS data exists, and then extrapolates the user’s location based on that. Unfortunately, accuracy can vary dramatically from a potential radius of several miles to several blocks; still, it’s better than no GPS at all. The 3G iPhone includes a true Assisted GPS (A-GPS), which supplements normal GPS service with cell network information. Although there is a difference in accuracy between the two types of GPSs, they can both be accessed through the iPhone SDK using the same interface.
Compass iPhone 3GS, iPad The iPhone 3GS added this piece of hardware, which drastically improves the iPhone’s capabilities as a navigation tool. The iPad includes a compass as well.

Among these hardware features, those that stand out are the accelerometers and the GPS, which aren’t the sort of things commonly available to cell phone programmers. As you’ll see, they spotlight orientation awareness and location awareness. The iPad has been stripped of many of the bells and whistles that are on the iPhone. Many users were disappointed when they found out the iPad would be shipped without a camera. Of the hardware features in table 1.2, the iPad only has Bluetooth, accelerometers, and a compass.

1.4. How the iPhone and iPad are unique

The iPhone’s core uniqueness goes far beyond its powerful web browser and its tightly integrated web functionality. Its unique physical form and the decisions embedded in its software also make the device a breakthrough in cell phone technology. Six core ideas—most of which we’ve already hinted at—speak to the iPhone’s innovation. Most of these ideas have carried over to the iPad. Understanding these elements (summarized in table 1.3) will help you in whatever type of development you’re planning.

Table 1.3. The iPhone has a number of unique physical and programmatic elements that should affect any development on the platform.

Unique element

Summary

  1. Always-on internet
A well-integrated, constant internet experience
  1. Power consciousness
A device you can use all day
  1. Location aware
A device that knows where it is
  1. Orientation aware
A device that detects movements in space
  1. Innovative input
Finger-based interaction
  1. Innovative output
A high-quality, scalable screen

We touched earlier on the idea of an always-on internet. What’s notable is how successful Apple has been in pushing this idea. Huge data-transfer rates show that iPhone users are indeed always on. In Europe, T-Mobile reported that its iPhone users transferred 30 times as much data as regular users. Google has also shown a notable uptick among iPhone users, who are 50 times more likely to conduct a search than the average internet user. Looking at overall stats, the iPhone’s Mobile Safari has become the top mobile browser in the United States and is quickly moving up in the international market as well. Anecdotal evidence is consistent, as friends talk about how an iPhone user is likely at any time to grab their iPhone to look up a word in Webster’s or a topic in Wikipedia, showing off how the iPhone has become the encyclopedia of the twenty-first century for its users. The iPad will surely continue this trend.

When Apple announced the iPhone, the company highlighted its power consciousness. Users should be able to use their device all day, whether they’re talking, viewing the web, or running native applications. Despite the higher energy costs of the 3G network, the newest iPhone still supports 5 hours of talking or 5–6 hours of web browsing. Power-saving tricks are built deeply and thoughtfully into the iPhone and iPad. For example, have you noticed that whenever you put your iPhone up to your ear, the screen goes black to conserve power? And that it comes back on as soon as you move the iPhone away from your ear? Power savings have also been built into the SDK, limiting some functionality such as the ability to run multiple programs simultaneously in order to make sure that a user’s iPhone or iPad remains functional throughout the day.

Thanks to its GPS, an iPhone is location aware. It can figure out where a user is, and developers can design programs to take advantage of this knowledge. But to preserve users’ privacy, Apple has limited exactly what programs can do with that knowledge.

Just as an iPhone is knowledgeable about large-scale location changes, the iPhone and iPad also recognize small-scale movements, making them orientation aware. As we’ve already noted, this is thanks to three accelerometers. They don’t just detect orientation; they can also be used to measure movement. This sophisticated input can be accessed by SDK programs.

Because the iPad is running the iPhone OS, most of its uniqueness is inherited from the iPhone. It may not be the first touch-only device to hit the market, but it’s definitely been shown to be the best based on the staggering number of initial purchases.

One of the most unique things about the iPad is its incredible support for orientations. There is no wrong way to hold the device. Never before has any device supported such a feature.

1.5. Understanding iPhone and iPad touch interaction

The iPhone and iPad use a multitouch-capable capacitive touchscreen. Users access the device by tapping around with their finger. This works very differently from a mouse.

But a finger isn’t a mouse. Generally, a finger is larger and less accurate than a more traditional pointing device. This disallows certain traditional types of UI that depend on precise selection. For example, the iPhone and iPad don’t have scrollbars. Selecting a scrollbar with a fat finger would either be an exercise in frustration or would require a huge scrollbar that would take up a lot of the iPhone’s precious screen real estate. Apple solved this problem by allowing users to tap anywhere on an iPhone screen and then flick in a specific direction to cause scrolling.

Another interesting element of the touchscreen is shown off by the fact that a finger isn’t singular. Recall that the iPhone and iPad touchscreens are multitouch. This allows users to manipulate the device with multifinger gestures. Pinch-zooming is one such example. To zoom in to a page, you tap two fingers on the page and then push them apart; to zoom out you similarly push them together.

Finally, a finger isn’t persistent. A mouse pointer is always on the display, but the same isn’t true for a finger, which can tap here and there without going anywhere in between. As you’ll see, this causes issues with some traditional web techniques that depend on a mouse pointer moving across the screen. It also provides limitations that may be seen throughout SDK programs. For example, there’s no standard for cut and paste, a ubiquitous feature for any computer produced in the last couple of decades.

In addition to resulting in some changes to existing interfaces, the input interface also introduces a number of new touches (one-fingered input) and gestures (two-fingered input), as described in table 1.4.

Table 1.4. iPhone and iPad touches and gestures allow you to accept user input in new ways.

Input

Type

Summary

Bubble Touch Touch and hold. Pops up an info bubble on clickable elements.
Flick Touch Touch and flick. Scrolls the page.
Flick, two-finger Gesture Touch and flick with two fingers. Scrolls the scrollable element.
Pinch Gesture Move fingers in relation to each other. Zooms in or out.
Tap Touch A single tap. Selects.
Tap, double Touch A double tap. Zooms a column.

When you’re designing with the SDK, many of the nuances of finger mousing are taken care of for you. Standard controls are optimized for finger use, and you have access only to the events that work on the iPhone or iPad. Chapter 6 explains how to use touches, events, and actions in the SDK; as an SDK developer, you’ll need to change your way of thinking about input to better support the new devices.

1.6. Summary

In this chapter, we investigated how the iPhone and iPad are truly unique devices. You’ve seen what they’re capable of and how they stack up in the mobile computing world. We went into detail about their technical specifications as well as their physical limitations.

The biggest constraints in iPhone development are potentially slow networks, the relatively small size of the iPhone screen, and the unique input interface. Although the first two are common issues for other networked cell phones, the third isn’t.

Although the iPad doesn’t suffer from the small-screen constraint, it has some hurdles of its own. One of the biggest challenges when creating an iPad app is considering all interface orientations. You have to do quite a bit of extra work to ensure that your app looks and functions in landscape as well as portrait mode.

In the next chapter, we’ll discuss the native language of the iPhone OS: Objective-C.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset