Software Development Tips and Tricks


Lewis and Clark: A Farewell

You’ve probably heard of Lewis and Clark, the explorers that made their way across North America from the Mississippi River to the Pacific Ocean. You probably haven’t heard of Lewis and Clark, iAchieved.it’s first iOS game. It was a flop, and at its peak had only about two dozen active users, half of which I knew personally.

That’s not fair, of course. Lewis and Clark was the springboard upon which I learned how to write an iPhone app, get it posted to the AppStore, collect iAd revenue (not much of it), integrate with Facebook, and work with Amazon.com EC2 services. Lewis and Clark also taught me the value of recognizing my strengths and weaknesses and working with others to help in areas I didn’t have the skills to make a great iPhone app (i.e., the artwork, and dare I say, marketing).

In addition, out of my desire to “be legitimate”, Lewis and Clark was the catalyst for forming an LLC, drafting an operating agreement, setting up a business banking account, and (shudder) learning how to file federal taxes for a business. So in the end, it wasn’t a flop, but the beginning of instilling the confidence in myself that I can do this, and learning from the mistakes I made along the way.

There’s a few objectives I have with this blog post. First, I’d like to say a final farewell to Lewis and Clark and thank all of the folks that were apart of it. With that farewell I’m going to write up what the app did, how it worked, provide a few screenshots, and then begin opening the private Github repositories.

The app description looks so cute now looking back on it. Join Lewis and Clark as they travel across the United States! Lewis and Clark is an achievement-based game that awards you points as you travel to new locations across the country. Each new state you visit, every county, parish, or borough you encounter, all of them will add to your score! Challenge your Facebook friends to a race to see who can accumulate the most achievements!.

And that’s precisely what the application did. Using the iOS CoreLocation framework L&C would send your GPS coordinates to a “cloud processing framework” which would “reverse geocode” (turn lat/long into an address) the coordinates, determine if you had already visited the location, and then award achievements and points. In fact, the company name, iAchieved.it, comes from being awarded these achievements. The whole idea of the game came from World of Warcraft achievements, as I played the game quite a bit between 2005 and 2011, and thought it would be fun to have “real world” achievements you could collect. Combine that with Facebook and a platform to play with your friends, and I felt that at the time it was a winning formula.

As you can see from the screenshot, as I traveled to California and landed in San Diego, I was awarded 10 points!


Each county visited would earn me points, in this one I think I had landed in Albuquerque before heading over to California.


It was fun and exciting to see the pop-up awarding points, and the map would update with the states and counties that I had been to. Friends that signed on with Facebook would see how many points I had on the leaderboard, and likewise I would see theirs.

As time went on I included a number of bugfixes to both the iOS application as well as the backend cloud services (written in Ruby for what it’s worth). Each release was increasingly more robust with sharper images, better feedback, less drain on the battery (it was a GPS application after all). Finally, I added a (what I thought was) cute puzzle game where you could scramble your state maps and then solve the scramble. It was something, and I had planned on adding more travel games and interesting “fun facts” about the states as I went.

Unfortunately, all of that came to a grinding halt when the app was rejected for using CoreLocation “inappropriately.” Apple felt (and I of course disagreed with) that the app should not require constant access to the GPS as it was not a navigation app. I explained why it did need constant access, and that there was a disclaimer on the app to use it while traveling, and to keep it plugged in. I went back to the drawing board and tried to use the CoreLocation “significant change” API, but time after time it failed on me, not being able to detect changes at a granular enough level (particularly in rural areas, a significant change would have been a handoff from one cellular tower to another, which could be miles away). I called Apple back up and outlined again my reasons for using the GPS at such a precise setting, and was declined. Well, that was the beginning of the end.

Dejected I simply gave up on the application. It continued to run, not making any money, and, since it used cloud servers and Amazon EC2, continued to suck up money. But, out of that experience, the company was founded, many technologies learned (Amazon SimpleDB and SQS play prominently in the backend as messages from the app are queued and processed via SQS and Ruby daemons, finally resulting in SimpleDB entries), and many professional contacts made. And, of course, there’s now a treasure trove of code (all in Objective-C I’m afraid) that will soon be released. Perhaps I’ll take the puzzle game code and convert it to Swift for a standalone demo. There’s a great book out there, Rework, that talks about how to take all of the byproducts of your creative efforts and turn them into products in their own right. Hopefully that’s what I’ll be able to accomplish with taking apart Lewis and Clark.

For a good laugh, here’s what Lewis and Clark looked like at the very beginning when I was in charge of the artwork.


That’s horrible! By the end it looked much better and, sure, I was proud of it. I am proud of it.


iAchieved.it LLC has now turned its attention to other projects. I’m continuing to try to blog about interesting topics, whether they be iOS development, finding a working implementation of SRP-6a in Python (that’s coming soon too I hope), or a post like this. We’ve also branched out into website design, and hope to a launch two new brands soon. Hopefully I will continue to find the time to provide interesting content for this blog (which really needs a cool name, any suggestions?). In the meantime, stay tuned and thanks for listening!


If you are still reading and want to know more about the technologies behind Lewis and Clark, a number of them were employed. Imagining that this app was “going to be big!” the design started off using Amazon Web Services SQS, or Simple Queue Service. The goal here was that eventually there may be thousands(!) of users all sending their GPS coordinates to be processed, and I needed a way to horizontally scale the application across multiple EC2 servers. So, SQS was used to take a message in on any server running the Honeybadger process (he don’t give a shit) and route it to a Bloodhound process (he’s on the trail!) to reverse geocode the location. Once Bloodhound had looked up the location and converted GPS coordinates to a county and state, it would get sent back to Honeybadger to determine whether the user had already been there.

Of course, questions such as “has the user already been here,” are translated into a database lookup, and again, I didn’t want a single MySQL database having to be accessed from all of these (potential) Honeybadger slices, so SimpleDB was utilized. Now I could truly scale this application out with any number of application servers running Honeybadger and Bloodhound. SimpleDB was also where all of the counties and states were loaded to, and how many points they were worth, and whether there were “meta-awards” for say, visiting all of the counties in a given state. Rather than carrying this information on the phone (and the nightmare of pushing updated information to individual phones), this too was all stored in SimpleDB.

On the iOS side, CoreLocation interfaced with the GPS gear on the phone to provide locations, and Amazon provided wrappers to SQS to easily put information on a queue. Push notifications were used to send down “you’ve got a new achievement,” and there was a single webserver running a Rails application responsible for allowing you to register your user, create a nickname, redownload your achievements in the event you changed phones, etc. Of course I didn’t want just anyone connecting to my webserver, and didn’t trust simple basicauth to get access to it, so client-side certificates were employed so only mobile clients that I built were allowed to communicate with the server. Of course, that implied there was a certificate in the application bundle, but it was password protected and I did put some effort into obscuring the password code.

I think one of the neater aspects was the ability to draw a state map with SVG and then fill in the counties that had been visited. It’s basically SVGs obtained from Wikipedia for each state with the counties drawn. For example, see this map, and then use your browser to View Source. There are 50 SVG files in Lewis and Clark, and using a loop technique to write the ‘fill’ attribute of all of the counties visited.

Quite an undertaking with different technologies and techniques learned. I will admit I shuddered when someone said, “Where’s the Android version?” Well, to that I say I’m a believer in the build it for the iPhone first school of thought, and if it takes off, then worry about Android.

Leave a Reply

Your email address will not be published. Required fields are marked *