Hail To The Pictures

April 2, 2009 at 9:28 am (Uncategorized)

“You have 48 hours to write an iPhone app…. GO!”

That was the theme of my weekend and the main question at the start of Friday evening was “What to do?”

Within the week leading up to the competition my friend, Mike Harlow, asked me to work with him during the contest. He proposed his idea, a photo-based dig-like app for the iPhone. I was immediately interested, but at first a bit worried. Without someone who had knowledge of how to write a back-end, storing photos was going to be difficult and time consuming. I expressed my concerns and we went our separate ways, brainstorming all the while. A few days later I had a solution, flickr would do our photo storage, and a simple app engine back-end could store any additional information and serve up our xml, a solution that I was confident could be implemented with the limited back-end knowledge we shared.

I went into the competition with two goals : to have a working app in 48 hours and get to bed each night. In the end, I was able to meet both of these goals.

After the first day of coding, we had a working list-view and photos loading from flickr via a YQL call. Everything seemed to be working quite well. A few other teams had some great ideas and I was very excited to see what would happen. I won’t discuss them in detail here as we’ve been talking about various IP issues in class, but the ideas ranged from stand alone applications, to interesting word games, to crowd-sourced experimental applications. The ideas were plentifu l.

The next day was UIScrollView hell. Mike had been working on the UIScrollViews over night and had some promising results. After we got our pictures loading properly into the app, we decided to go with an interesting UIScrollView idea that involved having two parallel scroll views, one for portrait view and the other for displaying data when the phone was horizontal. This led to a lot of dificult coding, and learning a lot about the intricacies involved in having two different views to accommodate different orientations.

We never would have come to the conclusion that a UIScrollView was a good solution for our problem if it hadn’t been for the whole group of iPhone programmers there. The environment was great for learning, as people ranged from having extensive iPhone knowledge to being cocoa newbies . Personally, I think it’s the environment that makes these kinds of competitions valuable. It doesn’t matter if you win or lose (though it certainly feels awesome to win) because the quality of knowledge you gain in the short period of time is far greater than a similar amount of time spread out over weeks, working by yourself. You aren’t just presented with the group resources in any other environment, and for that reason I feel like competitions like this one should be held more often .

The final day of the competition approached. I arrived at the CSE building at 10am sharp, delayed only momentarily by a bike race that was happening around North Campus . I came in with one goal: hook up the back-end. The App Engine back-end I had created was a simple hookup. A simple put request here, a get request there, and I was able to add photo IDs to my database and increase Hail and Fail counts. I had the back-end perform the YQL search similar to the following:

select photo,id,secret,description,farm,server,title from flickr.photos.info
   where photo_id in (select id from flickr.photos.search where text = "dog")

To the resulting XML, I added my hail and fail counts, and the back-end was complete. The next step was figuring out all of flickr in 3 hours. This was harder than I had imagined. I applied for an API key and got to work. After an hour, I had authenticated my flickr user to the program, but I still had no idea how to upload a photo. An hour went by, one hour until the competition was over, and I still wasn’t able to get a photo uploaded to flickr. Half an hour later, after writing my first post request, I had it! A photo loaded onto flickr from my app! Then came the title, and once again it was not working. With 20 minutes to go I found an objective-c MD5 implementation that allowed me to properly sign my requests. 10 minutes to go, I figured out exactly how to construct the response with a title and description…2 minutes to go, I test the app on the iPhone…1 minute, it works!

I don’t think either Mike or Myself would have been able to complete the application in 48 hours without the others help. The idea started out as his brain-child and together we made it a reality. Mike did a lot of the graphical work and layout, and I did most of the python back-end and flickr ’integration. We both worked on the core of the app.. Mike was a real trooper, staying thorough the night when many went to bed. All in all, it was a great experience, and I’m glad I had the opportunity to participate in another coding competition, although I really hope to get a lot of sleep this weekend!


1 Comment

  1. Watz said,

    Sounds like a pretty cool app

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: