Saturday, December 26, 2009

NC-17 Rated Hockey Twitter App on the iPhone

I've gotten feedback about HockeyTweet that goes along the lines:
  • An NC-17 Hockey app for the iPhone, that is my kind of hockey.
  • Hey, where are the girls in this app?
  • What no porn?
Kidding aside, why would I launch HockeyTweet with an NC-17 rating? It clearly is just a Twitter client for sending tweets about Hockey.

For most developers and those that follow the App Store saga, the reason is probably clear. For those that don't know let me explain. There is what is called a UIWebView, for non-programmers, this means a web browser view/window in my app. That UIWebView has access to Twitter so users can authenticate and if required to create a new Twitter account. There is a loop-hole in that UIWebView when you are on Twitter that means you could go out onto the Internet at large and view "objectionable material."

Since I allow the user to be able to navigate through Twitter to the internet they could view something that is objectionable. This sounds ridiculous and it is but the point here is that some apps have been rejected due to this and chose the route of least friction in the app review process.

So, yes, the app is rated NC-17. Does it have objectionable material in it? No. Should it be rated lower? Yes, but why would I go the route that has lead other devs to have their apps rejected?

Thursday, December 24, 2009

Designing HockeyTweet

It's been a long road, longer than I thought it would take but then aren't many things? How did HockeyTweet begin?

The main design goal of HockeyTweet was to create a fast Tweet creation interface for Hockey, specifically the NHL. This was born from the desire to allow people to quickly tweet their thoughts about the game without missing the action.

This desire stems from my youth, watching Hockey with my Dad. When there was a play we did not agree with we shouted out our protests. When there was an awesome save, there were shouts of joy.

So how do you bring this experience to the iPhone?

First I thought about how to speed up tweet entry. To do that let's save the user time by giving them the list of teams, players, penalties, and games. What did I need to consider for each?

  • Full name or abbreviation? Abbreviation wins out by far, we are only working with 140 characters in a tweet afterall.
  • Do we need to update this? Not if we limit our scope to the NHL (teams are pretty static, name changes are not common.)
  • Full name or abbreviated? After some testing and consideration for length, I went with full last name and first initial.
  • Numbers? Extraneous info, if you are a not a big fan you know the star's names but not necessarily their numbers. No numbers.
  • Do we need to update this? Yes, team rosters change often due to injuries, trades, retirement, new players, etc. This will need to updated regularly - need to consider this in how to perform updates.
  • Full name of abbreviated? For clarity and since I expect some of the long ones will not be used often I went with full name for each. Where the penalty had a common name that was shorter I used that.
  • Do these change often? No, no need to build in updating for penalties.
Game Schedule
  • How to handle showing a game? Use abbreviated team name with vs.
  • Games change often so this definitely needs to be updated on a regular basis.
  • Do we need time of the game? No, this app is for tweeting about the game while it is happening. Also, want to consider the day before and after since people may want to tweet about an upcoming game or yesterdays game. Time can be dropped.
  • Ok, we are showing yesterday, today and tomorrow. How are we showing that? I went with the 3 letter month and the date only.
    • Why no year? Don't need it, we are only showing current games, not previous years.
    • Numeric month would be shorter, why not use numerical month? You save 1 character for less clarity. Then you have to decide on a format MM/DD or DD/MM. I feel the 3 letter month provides more clarity, another decision done.

Handling Updates

During my design I identified that players and schedules had to be updated regularly. How to handle that? This was something new for me since I had to figure out how to do regular updates to my app without impacting the user experience in a negative way.

After some research I settled on web services as the solution. I first designed a web service with Perl SOAP::XML. What did I learn besides new tech (I had never programmed a web service before so this was all new)?
  • I know Perl well so writing the prototype web service took about 1.5 hours. Good references through The Perl Bookshelf and Google certainly helped.
  • Integrating the web service using asynchronous URL requests with asynchronous XML parsing was a mess. There was a lot of code to handle what was a simply a problem of go get some data and populate this array for display in the UIPicker. Trust me, the first pass of this code was ugly and hairy.
  • Where would I host this? My home system was out of bounds, I did not want to re-enter the world of IT and server maintenance to host my own web service. A hosted solution would work but that would cost money for an app that would likely have a limited customer base (iPhone Fans who are Hockey fans, that watch the NHL, and use Twitter). The total earnings for the app would probably not cover the cost of one year of hosting, so I needed something free.
  • How will this web service scale? Not sure, probably not well without lots or testing and more research to make sure I wrote a good web service.
  • How would I cache the web service data? In memory? On disk? If on disk how would I do that on the hosting service? What about Perl version? Which would the hosting service support? Could I install my own custom Perl modules? Many questions here to answer.
At the same time, hosting became an issue I had to solve. There were a lot of questions to answer for what appears on the surface to be a simple app. I had lots of tech to piece together so what next? Research!

Google App Engine

I started researching hosting solutions that offered the ability to run my own Perl services. All the hosting services seemed more expensive than I wanted to pay. Through the searching I kept coming back to Google App Engine. The pricing model is generous and I use lots of Google services which I find sometimes limited but get the job done 90% of the time.

How does Google App Engine work when hosting from it? My summary would be, unless you write something that is very successful, it's free. Once it starts to cost money (nothing for me yet) you should be already monetizing your product. If you are not making enough money to pay the generous hosting with Google App Engine then why are you offering the product?

Google App Engine had a kink though, I had to convert the already written (though prototype) service in Python or Java. Python was just poking it's head up at my day job so I figured why not go that route. At this time I enlisted a friend who was interested in the project. He signed on to rewrite the prototype Perl SOAP::XML web service using Google's App Engine and in Python. This relieved me of some work so I could concentrate on the app.

JSON 2.2 Framework for iPhone

Around the same time, I came across JSON 2.2 Framework for iPhone. Let me just say, that this is an awesome framework. It let me remove a lot of the hairy XML parsing code from my app and replace it with a clean implementation that effectively lets me pass Python Dictionaries of arbitrary complexity from the Python web service to HockeyTweet where the JSON string is cast to a Cocoa NSDictionary. The ease of using this library can not be said enough.

If you need to write a web service to work with the iPhone, look at Google App Engine, use Python, and the JSON 2.2 Framework for iPhone.

Ok, so time passed, my partner came and went; he had other pressing projects to work on. I finally finished version 1.0 of the app near the end of November. I submitted the app about November 28, 2009. Then it was time to wait.

iPhone Tech Talk Toronto

A week later I was off to Toronto for the iPhone Tech Talk World Tour. This is a one day conference where Apple Evangelists run 1 hour sessions (courses/tech previews/tech tricks) and provide services such as UX (User Experience) reviews. It is effectively a pep rally + course + feedback + networking session with Apple's face to the development community.


The UX Review and The Redesign

At the Tech Talk, as soon as I heard that there would be UX reviews I signed up for one. The review went well. I received valuable feedback from the Apple team which resulted in 10 new features they felt would polish the app and give it a Wow factor.

So began The Redesign. The list of features were:
  1. Improve the Info button (it was not very responsive)
  2. Change the text buttons to icons
  3. Add Arenas to the pre-loaded UIPickers
  4. Add a UIPicker for pre-loaded Hockey Phrases to give the app a more positive spin (the app had a negative spin with just the Penalties that could be combined with Players or Games)
  5. Make the Hockey Phrases user customizable
  6. Change the colour of the Add button from white to the same colour as the other buttons on the main view (the one different button made the view look unfinished)
  7. Indicate using colour (red) to the user when they typed a Tweet over the 140 character limit for a Tweet
  8. Make the fact that a Tweet was successfully sent clearer
  9. The buttons on the flipside view (Settings) could be retouched to make the app look finished
  10. (My own) Add pre-loaded Team rosters and Schedules so that if the user bought the app and ran it without an internet connection, there was data in the app from day one. The original design was to get the first load of data from the web service.
I worked almost every night for a week and I was ready to launch again.

Not so Fast

But first, I got feedback that the icons could use more polish. Eck! I hired a graphic designer online and he went to work on new icons. I received 5 of the 7 icons and had good ideas on the other two which I implemented in the tight deadline I gave him.

Phew! Now it was time to ship.

I uploaded again and on Monday HockeyTweet hit the App Store.

What would I do differently?
  1. Hire graphic help earlier in the process. Work with them to turn my paper/sketch prototypes into the UI which I code on the back end.
  2. Work longer on pinning down the design and the requirements before I start. I let feature creep push the app in a direction I had to reverse early in the process.
  3. Solicit more early UI design feedback.

Wednesday, December 23, 2009

Adding Twitter + OAuth to an iPhone App

First you will want a way to use the Twitter API. Go get MGTwitterEngine for that (I won't talk about that here since lots of people have explained it well). Get that and install it and play with it. You should be posting tweets very quickly from your app with Basic Auth.

Ok, once you get tweets sending and can retrieve tweets with Matt's code (MGTwitterEngine) you might want to start posting your tweets with your own app name and website. To do this you will need to use OAuth. See the Twitter API FAQ about OAuth and Twitter.

The best way to get this working on the iPhone is to use Ben Gottlieb's Twitter-OAuth-iPhone. This is a awesome piece of work by Ben, piecing together several examples, frameworks, and the OAuth process to make using OAuth from the iPhone a piece of cake.

Follow Ben's readme and sample project and you will be up and running with application branded tweets in no time.

Tuesday, December 22, 2009

First iPhone App: HockeyTweet has Launched

HockeyTweet is my first foray into the Apple App Store. HockeyTweet is a Twitter client which makes it fast to send Twitter updates about hockey games in real-time.

HockeyTweet is purpose built for the NHL. But enough of repeating the product page in the App Store, check out HockeyTweet in the App Store.

Here are some of the questions I've gotten about developing for the iPhone and what my next plans are:

Does it cost money to develop for the iPhone?
  • Short answer no, for the majority of people though the long answer is yes.
  • No, if you 1. Own a Mac, 2. Only want to write and test apps on your Mac.
  • Yes, if you 1. Don't own a Mac, 2. Want to run the app on your own device, 3. You want to post the app to the App Store.
Ok, how much does it cost?
  • $99/year (before taxes) for the iPhone Developer license.
  • $$$$ for your Mac
  • $219 CAN (before taxes) for the 8GB iPod Touch to approximately $1200/year for an iPhone
Does it cost any more?
  • Well yes, what is your time worth? If you are like me and you love to try new things, love to play with different programming languages and create, then this is not a real cost. If you add that time into your costs, it starts to skyrocket, but hey we are here to have fun and design cool apps that solve problems for people.
What are the tools like?
  • In a word, AWESOME. I love Xcode (the Apple provider IDE) and the toolset that it comes with. Basically everything I've used to write, debug, run, test software is available. The list of features is long but you won't be disappointed.
  • NOTE: Your mileage may vary if you don't accept the tools and learn them. I love vi, the editor is not vi. I decided with Xcode to not fight the tools and try to use replacements. This is paying off as I learn more shortcuts and they start to sink in.
What is next for me and HockeyTweet?
  • I plan to market HockeyTweet using several tactics with minimum cash. I'll write about how each of these pans out as I try them.
  • I will be working on the next version. The app is designed to allow me to quickly integrate other sports. I will be improving the design as I work on the second sport and seeing how I can improve the design to let me integrate other niches quickly.
  • I will be adding localization to the app for French.
  • I will be monitoring user input for future features and working on any issues that arise.
What did you learn technology wise? I've gotten to learn the following (or at least scratch the surface):
  • UI design
  • Objective-C
  • The Cocoa Touch framework - the SDK you build iPhone apps in
  • Web Services using Google AppEngine
  • Python for the Web Services
  • Dealing with performance and responsiveness in a constrained environment
  • Integrating open source frameworks into code
  • Managing deadlines with team members
  • Learning when to stop implementing and ship it ;-)
Is it hard to write an app?
  • Are you a programmer? Do you have passion? Are you ready to learn? If so, no it is not hard. Again, back to the time issue. If you have it and are willing to do a lot of self learning then it is fairly easy.
Do I have a website?
  • Yes, I am currently building Lockernine as my (planned) various apps home on the internet.
Have I had sales?
  • Yes, though does my wife and friends count?
  • I will post an update on sales numbers later once I have something interesting to report, be it good sales, or poor sales.

Wednesday, December 2, 2009

The Eve of iPhone Tech Talk Toronto

Phil Casgrain and I arrived today in Toronto via Porter. That was a great decision, Phil got to head into his companies Toronto office for some work and I planted myself at a Starbucks where I did work.

Tonight, thanks to Twitter, we saw that some iPhone Devs from Montreal were in the bar of the Hyatt (where the iPhone Tech Talk is being held Dec 3, 2009) and we headed over to meet some fellow devs. This networking was great, we got to trade some dev war stories, joke about the next great app (can you say a $69.99 web flashlight app? ok just kidding), and talk about many of the topics that have been floating about the internet with regards to iPhone development.

We also got to meet some of the Apple evangelists who will be leading the sessions tomorrow.

Some of the topics we covered included, but were not limited to, how app reviews are handled, the use of static analysis, strategies for releasing an app (be early with just enough or wait for more features and risk being beat out by another app), Square and it's new iPhone dongle payment system, how micro-payments are changing the landscape of the app store market, and more. As you can tell this was a lively discussion since Phil and I were there for only about 2.5 hours.

As a developer this type of socializing was a great experience. It is seldom, since University, that I have been in an environment where everyone is so into programming and are all floating about the same wavelength.

It's fun to roam among your own kind.