O'Reilly logo

iPhone Hacks by Adam Stolarz, Damien Stolarz, David Jurick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PREFACE

How important is mobile telephony? Over 2 billion people on Earth—over 1/4 of the world’s population—have mobile phones. And apparently half of those upgrade frequently—over a billion mobile phones are sold each year. But calling the iPhone a “telephony” device is shortsighted. The iPhone is a mobile computing device. And really, if you study computing trends, you’ll soon realize the iPhone is simply a computer.

The story of the iPod—Apple’s previous great personal device play—is a story that will be studied at business schools for the next hundred years. Apple sat back for several years, watching the MP3 and portable media player market. They let things mature a bit, and then entered the market with what became a “category killer,” a media player that outsold everything and became the very definition of portable music. Then they launched a digital music marketplace, that as of this writing is the #1 music store in the U.S.—beating every brick-and-mortar CD outlet.

Can they do it again? With the potential size of the emerging smartphone market, it’s hard to predict a world where the iPod is as wildly successful, in terms of market share, as the iPod was. Still, Apple’s numbers are impressive. In 2008 they sold about 10 million iPhones[1]. Compared to the billion phones sold worldwide[2] each of the last two years, that’s close to 1% of all phones sold—not just smartphones. Not bad for a new entrant with a high-priced gadget. Apple beat RIM (Blackberry) sales in 2008 as well and has become the third largest mobile phone supplier by revenues[3].

But this isn’t an investment book, this is a book about hacking the iPhone.

Computing and Communication

Since the dawn of smartphones, journalists have been bemused about mobile convergence: “This phone can take pictures, check your email and—surprise—even make phone calls.” But their sarcasm belies a lack of foresight and perspective on telephony. The multimodal nature of mobile communication encompasses voice, text, pictures, and video in a myriad of combinations. Conference calling, voice mailing, multiparty calling, hunt groups, broadcast texting, email reading, picture and video broadcasting, social networking, picture texting, microblogging, podcasting, videoblogging, reading, conferencing, real-time language translation, and telepresence are just a few of the ways that communication is being transformed by the emergence of the computerized phone.

The points we’re trying to make, with exclamation marks, are:

  • Mobile phones are permeating the global culture

  • Everyone will soon have a smartphone

  • Mobile phones are the future of computers

  • Mobile phones will fuel the next Internet boom

Why is this? One theory we’re presenting is that anything that makes communication more “telepathic”—transcending time and space—is likely to find universal affinity with humans. Thus, any device or technology that fundamentally enhances human communication will expand far beyond general expectations until everyone on Earth uses it.

Artists envision the future of culture in general. Science fiction writers envision the future of culture and technology, specifically.

But who prototypes that future? Hackers.

Please enjoy the book.

How to Use This Book

You can read this book from cover to cover if you like, but most hacks stand on their own, so feel free to browse and jump to the different sections that interest you most. If there’s a prerequisite that you need to know about, a cross-reference will guide you to the right hack.

How This Book Is Organized

This book is intended to be a compendium of hacks for both the iPhone and the iPod touch. While there are numerous books and sites that re-present the features inherent in the iPhone, this book collects many of the cleverest and least obvious innovations and presents them for easy application.

Chapter 1, iPhone and iPod touch Hacking Basics

There’s a lot of information out on the Web about “hacking” the iPhone and iPod touch, but it isn’t well sorted and not all of it is reliable. In Chapter 1 you’ll quickly learn the lingo so you can make immediate sense of the wealth of iPhone literature online. You’ll also learn how to simply, safely, and reliably “jailbreak” your phone to access a whole world of features and applications.

Chapter 2, Troubleshoot Your iPhone or iPod touch

Some people are concerned that hacking puts them outside the reaches of tech support unless they have a “hacker” friend at close hand. Far from it! If you have the right skills and the right support, you can hack with security and peace of mind. In Chapter 2 you’ll learn the basic iPhone “CPR” techniques cold. You’ll even learn how to get a referral to an online specialist if complications arise.

Chapter 3, Messaging and Communication

The iPhone is an unusually capable communication device, but Apple hasn’t satisfied every communication need. Chapter 3 shows you how to expand the iPhone to use a wide range of multimedia messaging, email, and Internet chat systems.

Chapter 4, Media and Data

The days of physical media, such as CDs and DVDs, are fading. Many people have already made the transition, and most of their personal and entertainment media is only in digital form on their hard drive, or “in the cloud” online. In Chapter 4 you’ll import your DVD collection and convert it for the iPhone, and then start getting your information diet—RSS feeds, news, and books—on your phone.

Chapter 5, Game Emulation

The power of the iPhone is such that it can emulate almost every classic video game system since Pong. In Chapter 5 you’ll learn how to take all the arcade games you have, from Nintendo, Sega, GameBoy, and original Playstation, and make them run on the iPhone or iPod touch.

Chapter 6, Telephony

Now that voice is just data, everything we’ve learned from the Internet can be applied to our telephone calls. Chapter 6 will show you how to use beyond Voice over IP on the iPhone and then cleverly combine voicemail, SMS, and voice-to-web technologies and make the most of the phone as a communication tool.

Chapter 7, Unlocking and Activation

The iPhone is designed to work on any GSM carrier in the world. And with some coaxing, it really can. In Chapter 7 you’ll learn all the techniques for unlocking the iPhone to work with a SIM card from the carrier of your choice.

Chapter 8, Customization

From background images to skins to system sounds to ring tones, customization has long been a mainstay of operating systems and mobile phones. In Chapter 8 you will learn how to make your iPhone your iPhone.

Chapter 9, Network Hacks

With Wi-Fi and 3G Internet access, the iPhone has better network connectivity than most laptops on the market today. In fact, in good 3G coverage areas, it’s as if the iPhone had a portable T1 Internet connection. The vast possibilities of this always-on networked pocket device are not lost on hackers. In Chapter 9 you’ll learn dozens of clever applications of near-ubiquitous connectivity, such as network remote control, GPS tracking, web serving, and laptop tethering. You’ll also learn how to bend a few rules, like running programs in the background on your iPhone and using VoIP over your 3G connection.

Chapter 10, Application Hacks

While the App Store application count has reached some astronomical number, only a handful of applications are innovative enough to be considered hacks. In Chapter 10 you’ll learn how to make music, measure, and manage media with your phone. You’ll also meet a group of App Store rejects that were too clever for their own good.

Chapter 11, Development Hacks

Computer programmers around the world are thinking to themselves “Maybe I should learn a bit about mobile application development.” But for many, the learning curve of getting used to the Mac and Objective-C has deterred them from pursuing iPhone development. In Chapter 11 you’ll learn that programming the iPhone is far easier than it seems. Any casual shell scripter will find they can make and distribute a useful and functional application in less than an hour. Professional developers will get a crash-course in iPhone development options.

Chapter 12, Hardware & Accessories

Today, the mobile phone is the computer. And computers beget accessories. Chapter 12 introduces the wide range of hardware connectivity possible with the iPhone and iPod touch. In this chapter you’ll learn how to hook an iPhone to a car and to a large screen television. You’ll learn how to perform surgery on the iPhone; how to wire it up to any serial device; and how to make it control an R/C car. You’ll even learn how to build what is for some the “holy grail” of iPhone connectivity—an external keyboard. Remarkably, for most of the hacks in this chapter, no jailbreaking is required.

Conventions Used in This Book

This book uses the following typographical conventions:

Italic

Used to indicate new terms, URLs, filenames, file extensions, directories, and folders.

$

The Unix/Linux shell prompt you see when logged as a normal (mortal) user.

#

The Unix/Linux shell prompt you see when logged as root (the superuser).

Constant width

Used to show code examples, verbatim searches and commands, the contents of files, and the output from commands.

Constant width bold

Used in examples and tables to show commands or other text that should be typed literally.

Constant width italic and bold italic

Used in code and commands to show text that should be replaced with user-supplied values.

Pay special attention to notes set apart from the text with the following icons:

Tip

This icon indicates a tip, suggestion, or general note. It contains useful supplementary information or an observation about the topic at hand.

Warning

This icon indicates a warning or note of caution.

The slider icons, found next to each hack, indicate the relative complexity of the hack:

Easy:

Intermediate:

Expert:

Also, unique to this book, is the “jailbreak” icon:

While some hacks can be done with a stock iPhone, many require the factory firmware to be altered (“jailbroken”) to allow new software on the device, as explained in Open Your iPhone or iPod touch to Customization by Jailbreaking. The jailbreak icon indicates whether jailbreaking is needed.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: iPhone Hacks, by David Jurick, Adam Stolarz & Damien Stolarz. Copyright 2009 O’Reilly Media, Inc., ISBN: 978-0-596-51664-2.

If you feel your use of code examples falls outside fair use or the permission given here, feel free to contact us at .

Acknowledgments

Thanks to everyone at O’Reilly Media who helped make this book happen, including Brian Jepson and Adam Flaherty for their editing; Nancy Kotary, copyeditor; Terry Bronson, production manager; Gretchen Bay, designer; Patti Schiendelman, indexer; and Ed Stephenson, cover copywriter.

We’d like to specifically thank Brian Jepson and Adam Flaherty for their unique contributions. Brian exhibited unflappable patience while managing what seemed like an interminable project. His mentoring on writing craft and geek credibility were invaluable. Adam Flaherty’s decisive editing tremendously improved the quality of the book, and his “give me three never-been-done-before hacks” challenge pushed the team to far exceed their original goals. And for the whole team, the care, professionalism, craft, and disciplined crunch-time effort that went into finishing this book is deeply appreciated by the authors.

David Jurick: I’d like to thank my parents for their unconditional support; my brother and sister; Damien Stolarz for all the mentoring he’s given me while growing up; Aaron Kinney; Jason Levine; Kyle Culkin; Illian McJohnson; all of the 40zoners (Chang, Eric, Peter, Ross, Allison, Micah, Karen); Amanda Scharpf; Kappa Sigma; Christian Sanz for having so much faith in my abilities; everyone at Deca for always laughing at my jokes; and last but not least, the all powerful creator of the universe—Science.

Adam Stolarz: Thanks to my mom for support, encouragement, and the sharing of pains; thanks to my dad for the work ethic; Damien for business and travel; Matthew for music and movies; and Jenny for art and humor. Additional thanks, in no particular order, to the Dodge Stealth, the Chariot, Rims, Lucky 13, the Lawltima, the Honda Civic, Verwend, and of course, the NQN. Shout outs to Team Entropy, Perdition Gaming, Phono, Jtubez, Jookasaurus, Augury, Brea/Lorea, and Halik/Kilah/Zikah. And a very special thanks to Luke: it’s complicated.

Damien Stolarz: The writing of this book has been an intense, watershed experience for me personally. I would like to thank Stephen Brown, James Rossfeld, and Steve Waterhouse for supporting me all these many months that I’ve slaved away on this book. I’d like to also thank my brothers Adam and David for tolerating my zeal. I’d like to thank Steve Jobs for being so on his game. And I must thank my wife, to whom I now owe 1.5 years of evenings and weekends. I will paint the trim on the front of the house now.

We’d Like to Hear from You

Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc./Maker Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
(800) 998-9938 (in the United States or Canada)
(707) 829-0515 (international or local)
(707) 829-0104 (fax)

We have a web page for this book that lists errata, examples, and any additional information. You can access this page at: www.makezine.com/go/iphonehacks.

To comment or ask technical questions about this book, send email to .

Maker Media is a division of O’Reilly Media devoted entirely to the growing community of resourceful people who believe that if you can imagine it, you can make it. Consisting of MAKE magazine, CRAFT Magazine, Maker Faire, and the Hacks series of books, Maker Media encourages the Do-It-Yourself mentality by providing creative inspiration and instruction.

For more information about Maker Media, visit us online:

MAKE: www.makezine.com
CRAFT: www.craftzine.com
Maker Faire: www.makerfaire.com
Hacks: www.hackszine.com


[2] Gartner research

[3] Jobs, Q3’08 Earnings call

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required