Wednesday, April 29, 2009

Book Review: iPhone in Action

iPhone in Action, Introduction to Web and SDK Development, is 50% off the regular price until April 30, 2009. To get the discount, just go to the publisher's site and when you order use this code: tuaw50. This is only for the current edition of iPhone in Action. If you miss the sale, Amazon has it for sale at 34% off.

This book is a great starter book and we used it to help us with the development of our first iPhone application. The best part of buying this book was getting the downloadable PDF version for free. That helped a lot, especially when we needed to copy examples from the book.

The book does provide ample coverage iPhone development. This includes web and native apps. The tutorials are very good and there are code examples for most major iPhone areas. Although our app was not a web app, which a full third of the book covers, we found it interesting to read this part of the book. Later on it helped us with adding web access to our app. The native app part of the book introduces the SDK, starting with an overview of Objective-C and XCode, and then follows up with excellent step by step tutorials. These tutorial teach you how to use Interface Builder and the different kinds of view controllers to create your GUI. The part of the book covers graphics, web interaction, SQLite databases, using the address book, etc. iPhone in Action is great for experienced programmers and iPhone development beginners, mainly because it covers both web and then SDK.

If you want to sample the book before you buy, the publisher has 3 chapters you can download, as well as all the source code from the book. Just visit the Manning Publications website to check it out. The free ebook that accompanies the book is provided by the publisher at their website as well. You have to buy the book to get the code they require when you click on the ebook link.

As always, we will provide you with some comments from other reviewers that do not share our opinion on the book:

A very basic introductory book to iPhone programming, says "IT Developer," my major complain is that it either left out the important stuff or only roughly addressed them. For example, NSException handling is not even mentioned in the book.

Barry A. Starrfield writes: All about HTML Programming. "Be aware that this book is strongly focused towards iPhone Web applications development. Sadly, your Web based iPhone app is not what consumers want - they want an SDK application, and those are the applications that you'll get paid for."

Wednesday, April 22, 2009

Book Review: The iPhone Developer's Cookbook

Overwhelming, reviewers have both praised Erica Sadun's book The iPhone Developer's Cookbook: Building Applications with the iPhone SDK and warned that it's not for beginners. We found this book very helpful during the development of our first iPhone app (Phone Alarm) and were pleased that it came in both paperback and PDF. I particularly like books that come with a companion PDF version.

Erica Sadun first explores the iPhone delivery platform and SDK, helping you set up your development environment, and then shows you how iPhone applications are constructed. Next, she offers single-task recipes for the full spectrum of iPhone/iPod touch programming jobs:
• Utilize views and tables
• Organize interface elements
• Alert and respond to users
• Access the Address Book (people), Core Location (places), and Sensors (things)
• Connect to the Internet and Web services
• Display media content
• Create secure Keychain entries

I thought it was a great book whether you had experience or not, but I found several other reviews that disagree:

Jason R. Weiss (Katy, TX USA) writes: New to Apple's Developer Tools? This book is not for you!, The book states it is aimed "squarely at anyone just getting started with iPhone programming." It is not...

Perfect for seasoned programmers, writes J. Badger. If you're an accomplished Objective C programmer then this book really helps you understand the fine points of iPhone programming...

Bernhard Müller cleary warns that This should be your SECOND iPhone programming book!She shows a lot of tricks you won't see in the standard books. But to really enjoy this book, you should know iPhone programming at least basically...

Wednesday, April 15, 2009

Push Services Too Costly For Some iPhone Developers?

The long awaited for push notification service for the iPhone is available in iPhone OS 3.0 and developers are being encouraged to start testing push with Apple's server. Push services have the potential of bringing a whole new level of innovation to iPhone app development. However, the potential cost involved in developing and maintaining a push server for your app may be prohibitive. Yes, Apples does maintain and provide access to the Push Notification Service, but you, the developer, must provide the "3rd Party Server" as shown in the picture above. Apple only provides the piece that allows a well formed message to be sent to a designated (and registered) device. You have to form that message and designate the receiver. And for that you'll need your own server. Erica Sadun put it this way in a recent article at Ars Technica:
Consider an application with just 10,000 users. It might service a million uses per day, assuming update checks every 15 minutes. More time-critical uses might demand checks every few minutes or even several times a minute. As the computational burden builds, so do the hosting costs. While cloud computing provides an excellent match to these kinds of needs, that kind of solution comes with a real price in development, maintenance, and day-to-day operations.
She makes it sound fairly daunting and this may scare off some developers. But I think developers will find a way to make this work either by using cloud computing or sharing resources. There's one company,, that's already offered to host push services for developers. They advertise their service starting at $35 per month. And if you are staying current with the iPhone Developer Forums, you'll see that code for these back end push servers is already being shared and is running on Mac and Linux servers. I think it would be worthwhile to take some of this work and put it on the cloud using Amazon's EC2. The initial costs of running a low-end Amazon Machine Instance is around $72 per month (doesn't include data storage or network usage). Between that and the results of the experiment is conducting, we may find that the costs can be contained.

Wednesday, April 8, 2009

iPhone Application Programming Course

Stanford University has begun publishing video podcasts and slides from its popular "iPhone Application Programming" course on iTunes U for free to the general public, beginning this week.
Course description:
Tools and APIs required to build applications for the iPhone platform using the iPhone SDK. User interface designs for mobile devices and unique user interactions using multitouch technologies. Object-oriented design using model-view-controller pattern, memory management, Objective-c programming language. iPhone APIs and tools including Xcode, Interface Builder and Instruments on Mac OS X. Other topics include: core animation, bonjour networking, mobile device power management and performance considerations.

Offered by Stanford's School of Engineering, the course will last ten weeks and include both the lecture videos and PDF documents. A new lecture will be posted each Wednesday and Friday.

I checked iTunes last night and so far 2 videos have been posted, accompanied by lecture slides (PDF):
  1. Introduction to Mac OS X and Cocoa Touch (April 1, 2009) 1:04:45
  2. Using Objective-C, Foundation Framework (April 6, 2009) 1:09:00
Here's a direct link to Stanford on iTunes U's iPhone Application Programming.

Wednesday, April 1, 2009

Unit Testing Tips and Techniques for iPhone

"...Unit tests help ensure low-level code correctness, reduce software development cycle time, improve developer productivity, and produce more robust software."
-Unit Test Frameworks

As important as unit tests are to modern development efforts, the iPhone SDK makes it difficult, if not impossible, to introduce unit tests. However, there are some useful resources online that can help developers shoe-horn a unit test framework into the SDK. One of these is based on the "Google Toolbox for Mac" project. They've extended their toolbox to provide iPhone Unit testing. You can find their well-written HOWTO at the iPhoneUnitTesting page.

The other resource I suggest you look at is from the folks that brought the OCUnit framework to Apple's Xcode. At the iPhone Unit Testing page of their website, you'll find the history of OCUnit and precise instruction on how to get it to work with the iPhone despite Apple having put OCUnit into iPhone SDK 2.2.!