So long Michigan!

Today I gave my 2 weeks notice at TechSmith. It was a tough choice to make but after lots of deliberation, I decided it was time to try something new.

When I was a senior in college 3 years ago, I never expected to take a job in Michigan. I didn’t think the kind of software job I wanted existed here. Then I found TechSmith. It’s a medium sized software company (just over 200 employees) located just outside of Lansing, Michigan. It’s really like finding a little piece of Silicon Valley in the heart of the state. It had everything I wanted except for one thing, location.

I’ve lived in Michigan my whole life. I grew up here. I went to school here. I don’t know what it’s like to live anywhere else. I’ve never had to call pop, soda and I’ve never had to deal with speed limits on the highway lower than 70. I want to live in a big city and be able to drive to the ocean. I want to be able to go skiing on real mountains that aren’t man made.

So I will be moving to Washington to work at Microsoft on the Windows Embedded team. To my friends, it might seem like an odd choice. I’ve never been the biggest supporter of Microsoft (I don’t even own a computer that runs Windows). For me, it makes sense. I’ve always wanted to work for a huge big name software company. Not just for the name, but also because at a company like Microsoft, the software I write can have an impact on millions of people. The code I write will affect the daily lives of so many people that I might actually be able to change the world. That’s pretty cool.

Posted in Uncategorized | Leave a comment

Easy App Store Promo Code URLs

Apple lets developers generate 50 promo codes so they can give out their paid apps for free. Developers can use these for reviewers or to get some good PR on Twitter. Apple made it really easy to redeem the codes by making it possible to embed them in a URL that will open up iTunes and take you right to the page to redeem it for you.

Lots of people don’t know that you can do this with promo codes and URLs. I’m not sure who figured it out, but it seems like Tap Tap Tap was the first to figure it out. One problem with this is that once someone clicks the link and redeems the code, it’s invalid. So only the first person to click the link gets it, otherwise they get a dead link that shows you an error message in iTunes.

So I tried to solve those problems with my App Store Promo URL Generator. It lets you paste in your App ID and some promo codes and it will generate a URL you can use to share multiple promo codes with one link.

It works by using your App ID as a key to pull out a promo code from the list you entered. It will pull a new code from the database until it runs out. When it is out of promo codes, instead of getting an error message, you will be redirected to the apps page in the App Store.

I threw this together using the Twitter bootstrap page template to make it look nice. I used some simple php and MySQL to take care of the rest.

I hope you find it useful and would appreciate any feedback you have.

Promo Code URL Generator

Posted in Uncategorized | Tagged , , | 4 Comments

Why I’m sticking with GoDaddy… for now.

Yesterday I was all ready to start switching my domains from GoDaddy. I was reading articles about how to do it and wondering how hard it was to migrate a WordPress blog. I got to work and started running WHOIS queries to see who my company’s domains were registered with, ready to start sending emails about how we should change it. Then I opened Hacker News and saw that GoDaddy had flip flopped. They bit the bullet and admitted they were wrong. Getting angry on the Internet had finally worked!

So what was the Internet’s reaction to this? “Who cares!? GoDaddy is still terrible! Transfer everything anyway!” GoDaddy did EXACTLY what everyone wanted but they wanted more? That seems pretty unfair and it defeats the purpose of the boycott. Instead of being about helping stop SOPA, it became about stopping GoDaddy.

I don’t disagree that GoDaddy kinda sucks. Their site is confusing as hell and they try to upsell you all kinds of shit you don’t need. They’ve called me more times than just about any other company I’ve ever bought anything from. But their product isn’t so bad. Their domain name prices are competitive and their hosting (for me) has been rock solid.

GoDaddy did a good thing today, and for now, the pain of switching is greater than my bad feelings for GoDaddy.

Posted in Uncategorized | Tagged , | 2 Comments

RBAdView a simple drop in iAD implementation

It’s pretty easy to add iAds to your iPhone app. The simplest thing you can do is drop an AdBannerView onto your interface in Interface Builder. That is the bare minimum you need to get them working. The problem with that is that ads don’t always load. When they don’t load, they leave an empty space and that looks kinda shitty. So what do you do?
You implement the iAd delegate methods and handle the errors. I hated doing that every time I added a new ad so I built RBAdView.

RBAdView is a UIButton subclass that shows an iAd when it can. When the iAd fails to load, it behaves just like a regular UIButton.

To use it, you can just put it in interface builder and be done, or you can add it programatically.

   RBAdView *rbBanner = [[RBAdView alloc] initWithFrame:CGRectMake(0, 100, 320, 50)];
   [rbBanner setBackgroundImage:[UIImage imageNamed:@"RBAd0"] forState:UIControlStateNormal];

   rbBanner.actionBlock = ^(ADBannerView* banner, BOOL willLeaveApp){
      NSLog(@"Banner will open %@",banner);
      return YES;
   };

   rbBanner.finishedBlock = ^(ADBannerView* banner){
      NSLog(@"Banner finished %@",banner);
   };

   [self.view addSubview:rbBanner];

There is an actionBlock that you can add that will get called when an iAd gets pressed. It will let you do things like pause your game before the ad takes over the screen.

The finishedBlock gets called when the user closes the ad.

If you have any trouble getting it to build, make sure you add the iAd framework to your project.

Check it out on GitHub.

Posted in Uncategorized | Leave a comment

Where does my blog traffic come from?

It’s been a little over a year since I started this blog and I wanted to look back and see how the blog is doing. I thought it would be interesting to show my most successful posts and explain how I drove the traffic to them.

1. 20 Minutes with my Chromebook (9,728)
When I got my Chromebook I was a bit disappointed with it, but I believed it had some real potential. I wrote up a review of my initial impressions and posted it to Hacker News. It got picked up and made the front page. Most of my traffic came from the first few days after it was on Hacker News with a huge spike on the first day and then a tail of requests as people caught up on their RSS readers.

2. How to change the color of a UIBarButtonItem (3,264)
When I was working on one of my apps, I wrote a simple bit of code to change the color of UIBarButtonItems on the iPhone. I posted my answer to a few questions on StackOverflow and that drives most of the traffic for this post. It’s consistently my most visited post of the day, but it never got a huge spike like any of my posts that were featured on Hacker News.

3. What I learned from working with my first client (3,208)
This is another post that made it to the front of Hacker News. There are a lot of freelance developers on Hacker News and anything you post and people love to learn from other peoples experience.

4. Toto (2,212)
This is the main page for my app Toto, which received a good amount of traffic the day that the Mac App Store launched. Toto was one of the apps in the store at release and the only free to do list app.

5. Home Page (1,707)
I imagine most of this traffic comes from when people visit my other posts and want to see what else is on the blog.

6. Introducing HappyCampfire, a Campfire framework for OS X and iOS (1,254)
Another Hacker News driven post. This one also ranks high on Google searches for an iOS or Mac Campfire framework.

7. Afternoon Apps: Descrumbled (898)
Hacker news again (see a pattern?)

8. QDoba vs. Chipotle vs. Panchero’s (781)
One of my oldest posts. It was kinda from before I had an idea of what the blog should be about. It’s mostly from people searching for information about the restaurants or pictures of burritos.

9. How to change the color of UIBarButtonItem on iOS 5 (684)
In iOS 5, Apple made an easy way to change the color of a UIBarButtonItem. I made this post and linked to it at the top of the post I mentioned at number 2. It gets about 70-80% of the traffic that the other post gets.

10. Replacing the screen on your iPhone 4 (580)
Posted this to Hacker News as well which got it a decent amount of traffic at first. I also get a lot of traffic from people searching how to replace your screen.

Just submitting an app to Hacker News will usually get me about one or two hundred hits. If it hits the front page it will be a bit more. My top post was on the front page the longest (probably about 3 or 4 hours) and it got about 10k views. When I post a new post (without submitting it anywhere) I’ll se a slight bump in traffic. I guess it’s from a handful of subscribers or maybe it’s just me checking to see how the post looks.

Posted in Uncategorized | Leave a comment

Afternoon Apps 2: Scrumbled

A few weeks ago I made an app called Descrumbled for cheating at Boggle. I wanted to see if I could build an app in a single afternoon. I built it and released it in one day. The next weekend, I found myself with some more free time and I decided to see if I could do it again. The idea was that I would take my Boggle cheating app and turn it in to a Boggle playing app. So I branched Descrumbled and got to work.

The hardest part of a Boggle app is knowing what words are valid. You need to take a grid of 16 letters and evaluate the thousands of possible combinations against a dictionary of over 200,000 words. Luckily, that was already done.

I didn’t want this to be quite as simple as Descrumbled. I wanted to make it actually worth playing. To do this I added Game Center achievements and a social challenge option.

Basically, there are achievements designed to get you to play the game more. The achievements require you to do things like play 100 games and get certain high scores. There is also a leader board that people can use to see how they stack up against the rest of the world.

Achievements and leader boards are great, but I wanted to add a little bit of a multiplayer aspect to the game. So I added a feature so you can send someone a game board as a challenge. When they click the link in a text, tweet, or email it will open up that game board and let you play it.

The only other sort of interesting thing I did was with advertising. Instead of relying only on iAds, I put in an ad of my own, for Descrumbled. Sometimes iAds fail to load. When that happens, I show a button with an ad for Descrumbled asking the user if their puzzles are too hard. It’s not super exciting, but it might drive a few more people to download one of my apps and it looks better than a blank space where the ad didn’t load.

This app didn’t take a single afternoon. I think I spent probably 3 afternoons on it. When I had it mostly working, I decided to add the social challenge feature and had to change the way the app was architected. That took a little bit more time than I wanted it to.

Be sure to check it out and let me know what you think.

Posted in Afternoon Apps, Uncategorized | Tagged , , , | 1 Comment

Taking control of the volume buttons on iOS, like Camera+

Camera+ just got VolumeSnap back in their app. If you don’t know the story, Camera+ used the volume button on the iPhone to snap a picture. Apple rejected their app and kept them out of the store for three months when they found out. Then when iOS 5 came out Apple implemented volume snap in their own camera app. So now that Camera+ has it again and Apple seems to have relaxed their policy, I tried to figure out how Camera+ did it.

I came up with this class RBVolumeButtons. You use it like this:

   RBVolumeButtons *buttonStealer = [[[RBVolumeButtons alloc] init] autorelease];
   buttonStealer.upBlock = ^{ 
      counter++;
      [counterLabel setText:[NSString stringWithFormat:@"%i",counter]];
   };
   buttonStealer.downBlock = ^{ 
      counter--;
      [counterLabel setText:[NSString stringWithFormat:@"%i",counter]];
   };

It’s really that simple. Here’s how I did it.
Continue reading

Posted in Uncategorized | 13 Comments

Afternoon Apps: Descrumbled

At events like Startup Weekend, you try to build an idea in a weekend. I wanted to see if I could do something even faster. So I bring you Afternoon Apps, where I build an app in a single afternoon.

Descrumbled is an app for solving Boggle puzzles. Boggle is a word game where you have to find words hidden in a grid of letters. The app lets you enter a board and quickly generate all possible words that can be found in the puzzle. It uses the SOWPODS dictionary to see if a word is valid or not.

I was able to build the app in an afternoon because it is very simple. It lets you pick two board sizes, 4×4 and 5×5. Then you can enter the board, press solve, and seconds later you get a list of all the words. Pressing a word will give you the definition thanks to iOS 5’s dictionary integration.

The hard part was actually solving the puzzle. Generating all the possible words in the puzzle and checking them against a 230,000 word dictionary is no trivial task. I’m going to let you in on a little secret. I didn’t write the boggle solver in a single afternoon. I had written it before by working on it a few hours a day for 3 or so days. It was a programming challenge I found online and I tried to do it. It’s actually a lot of fun solving a problem like this. I get to think about tries and binary searches. Things I haven’t actually had to think much about since college. My first stab at it took about 3 minutes to solve a 4×4 puzzle. Since most online Boggle rounds are 1 or 2 minutes, this obviously wasn’t acceptable. I improved my algorithm and now it takes ~1 second to solve a 5×5 puzzle.

So what did I actually do in an afternoon? I built a UI around my boggle solver class. I had to get a C++ class working on the iPhone (which is actually really easy) and build a UI for entering the board. The squares on the board auto advance the cursor through a grid of UITextFields. It also makes sure the board is complete before it tries to solve. Then I had to make a way to clear the board and switch between a 4×4 grid and a 5×5 grid. The word list UI is just a very simple UITableView. When you press a row, it will open up the definition of the word in a UIReferenceLibraryViewController (new in iOS 5).

That’s it. The app is meant to be simple and easy to use. It really is a minimum viable product. I did this as an exercise to see if I could build a simple app and submit it to the app store in an afternoon. I want to keep doing these Afternoon Apps every few weeks. I’d love to see if other people have done similar things and find out how your experience went.

The app should be live any day now. Check it out!

Posted in Afternoon Apps | Tagged , , , | 7 Comments

Making your iPhone app look great on an iPad

Running an iPhone app on an iPad isn’t the best experience. It doesn’t use the iPad keyboard and everything looks very pixelated. Ideally, you would build an iPad version of your app, but that’s not always worthwhile. The iPad is a very different beast than the iPhone and it usually involves creating a completely unique experience for your app. So how can you make your iPhone app look better on an iPad?

Images. With the iPhone 4, Apple introduced an image naming schema that would allow you to load large images for the retina display and small ones for devices without it.

When the iPad launches an iPhone app, it launches it at the original iPhone resolution of 320×480. When you press the 2x button on the iPad it will stretch it out to 640×960 (the same resolution as the retina display).

This stretching, makes everything double in size and it all looks pixelated. So if you have an image that is 100 pixels wide, it will become 200 pixels wide and look like crap. But what happens if the image you provide is already 200 pixels wide?

It turns out that it looks pretty good. It shows up at the correct resolution with no pixelation.

The only problem with this is that if you give it a low res image, it will load it. Then it stretches and looks like crap. What you need to do is forget about the low res images and just include hi-res images.

“Won’t it look bad on the iPhone 3GS?” No. It’ll look fine. It’s scaling by half. Even the most rudimentary scaling algorithms look fine when it’s perfectly halved. You might lose a little bit of detail on some images, but it’s not much more detail than you’d lose using Photoshop to scale the images. Nobody will notice.

You can use the @2x naming convention if you want to, the images will all load just fine. There is a bug in Xcode 4’s interface builder that causes it to fail to load the images unless you put the @2x in the image name. This used to work in Xcode 3 before.

Including 2 images now is kind of silly. It makes the app larger (which can prevent you from downloading over 3G) and adds extra files that you need to manage. It’s easy to misname an image and end up with a pixelated piece of crap on your phone. The large images look just fine on the low res screens. I promise. It’s really too bad that iOS doesn’t render an iPhone app at the larger resolution on the iPad. It already knows how to draw the app at the double resolution for the retina display. Maybe with iOS 6.0.

Posted in Uncategorized | Tagged | 2 Comments

Building a static library that works on the iPhone and the simulator

Apple’s iPhone simulator runs really smooth and fast. This is because they aren’t emulating the ARM code on your Mac, they’re actually building x86 binaries that will run in the simulator.

Because of this, code written for the iPhone needs to be compiled twice, once for the simulator and once for the device. This makes working with static libraries a bit of a pain, because you need two of them, one for each architecture.

Luckily, it’s possible to build a “universal” binary that will work with both architectures. Apple did this during their switch from PowerPC to Intel.
Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment