Authenticating with Google App Engine

I've finally got around to doing some work on that iPhone application that I've committed to finishing this month.

On days I do a lot of work on the app, I don't feel obligated to work too hard on the blog, but I will post a little something about whatever I worked on. Today, I got my iPhone app to connect to a Google App Engine-based web site.

Without giving away too much, I'll just say that the iPhone app and the web site work together to provide a service to iPhone users. I put the web site together in a couple of weekends. I decided to use Google Accounts for authentication, meaning that to log into my web site, either via a web browser or via the iPhone app, a user has to provide a Google account ID and password.

If you do things this way, the server-side authentication stuff is easy. However, writing the client side is not easy, because the mechanism for authenticating with a Google account and connecting to a Google App Engine web site is not well documented. Luckily, I found a Stack Overflow question and answer that provided all the clues I needed to get my iPhone app working.

After using Google's API for implementing the web site, I'm growing increasingly frustrated with the Cocoa APIs. What takes two lines of code on the web side takes dozens of lines of code on the client side. Simple operations like connecting to a URL, downloading data, and storing it to a local database requires a lot of boilerplate code on the Cocoa side. It's not difficult, but it's incredibly verbose.

I should note that I'm using the Python API for Google App Engine. If I was using the Java API, then I'm sure it would be as grotesque as the Objective-C stuff.

Changing Background Color and Section Header Text Color in a Grouped-style UITableView

While working on an iPhone application, I decided I wanted to change the colors of the background and section headers of a UITableView with the UITableViewStyleGrouped style. It took a lot more work than I expected, so I'm sharing what I learned with anyone else who needs to do this.

Adding a Custom View to an NSStatusItem

My Menubar Countdown application uses an NSStatusItem to display itself in the menu bar. I recently had to add a custom view to that status item, and thought I'd share what I learned about the process here.

Menubar Countdown 1.0 for Mac OS X Released

Lately, I've been experimenting with the Pomodoro Technique for time management. The basic idea is that you work in focused 25-minute bursts, with short breaks between bursts. You are supposed to use a kitchen timer to avoid getting distracted by looking at the clock.

Of course, as a computer guy I'd like my timer to be on my computer. I looked around for a Mac application that would provide an unobtrusive 25-minute countdown timer, but I didn't find any that I liked. So I decided to write my own.

Menubar Countdown is the result of that effort. It displays a countdown timer on the right side of the menu bar. It has menu items that allow you the user to start, stop, or resume the timer.

There are three options for what you want to happen when the timer reaches 00:00:00:

  • Play the system alert sound (which I never notice).
  • Display an alert window (which is effective, but you may not like the abrupt interruption).
  • Speak. This is my favorite option. You can specify what you want the application to say.

It's free software, distributed under the terms of the GNU General Public License.

Source code is included. Other neophyte Cocoa programmers might find it useful as an example of using such classes as NSStatusBar, NSStatusItem and NSUserDefaultsController, or for measuring absolute time in a Mac application.

You can download the application from my snazzy new corporate web site: Menubar Countdown product page.

Syndicate content