Why GroupMe kills the battery on your iPhone

I was really excited after I read about Path sending address book data to their servers. Not because of anything with privacy, but because the post showed me how to snoop traffic on the iPhone. I could finally figure out what GroupMe was doing to absolutely destroy my battery when I left it running.

GroupMe is an excellent service. It makes it very easy to create groups and communicate with them. My team at work actually ditched Campfire to use it because of how much we were talking on our phones outside of work. There’s one big problem though, it absolutely destroys your iPhone battery.

The Internet tells you to turn off location services for the app to solve the problem. That might have helped if I was using location in the app, but I wasn’t. My battery still would drain like crazy, even when my phone was asleep. It feels like my phone is going to overheat and explode.

So what the heck is GroupMe doing? I hooked up mitmproxy and opened up GroupMe. I saw all the expected traffic when I was loading messages and sending them.  When I closed the app though, the requests didn’t stop. I noticed lots of requests that look like this http://chat.groupme.com/event?token=33367a776311af00asdfas6869d43b9e&flush=true happening over and over again. GroupMe is polling for new messages, constantly, in the background.

Luckily, the iPhone kills the app after about 10 minutes, but 10 minutes of constant network activity is still going to do plenty to drain the battery. What I don’t understand is why they’re doing this. All it gains them is not sending a push notification to that phone for the next 10 minutes.

Posted in Uncategorized | Tagged , , , | 6 Comments

How to preview your icon on the iPhone

There are very few screens that can match that of the iPhone. Because of this, it’s hard to get an idea of what things will look like on it, without actually putting it on the device.

So how do you put the icon on the device? Well, you could set up a developer account and deal with certificates and provisioning profiles, then build and deploy your app to your phone. If you’re already an iPhone developer, this isn’t too big of a deal. What if you’re a designer? What if you’ve never set up an iPhone app before? There is an easier way.

iOS lets you add website bookmarks to your home screen so it looks like an installed app. To do this, you just have to add a link tag to your html that specifies the icon you want to use. Then you visit the site, add it to your home screen and you can see what it will look like.

Doing this by hand is definitely easier than building and deploying a full iPhone app, but it still is a time consuming multi-step process. I built something to make it a little bit easier.

With my iOS Icon Preview generator, all you need to do is upload an image and type in your phone number. It will generate the html necessary and text a link to your phone so you can add the page to your home screen and preview your icon.

I’m using Twilio to send text messages, which costs me a bit of money. It’s not expensive, but if the service took off, it could be. So I’m going to charge a bit of money for it. The way it will work is that you’ll get 10 icon previews for free. After that, you’ll have to pay $1 to recharge the generator and you’ll get 10 more previews.

Let me know what you think of the service, and the revenue model.

iOS Icon Preview Generator

Posted in Uncategorized | Leave a comment

Working at Foxconn sounds a lot like working at an amusement park

I spent two summers in college working at the amusement park. I had a lot of fun and met a lot of great people. Some articles about Apple have brought Foxconn back into the news recently. One thing that struck me as surprising was how similar it sounded to my amusement park job.

A production line in Foxconn City in Shenzhen, China. The iPhone is assembled in this vast facility, which has 230,000 employees, many at the plant up to 12 hours a day, six days a week.

The park where I worked may not have had 230,000 employees, but a 12 hour shift, six days a week was NOT an unheard of thing. In fact it was pretty common. An open to close shift could be more than 13 hours. Some of the less popular departments, the people who picked up trash for example, were often understaffed and their employees would have to work all day every day. Days off? We got 1 a week.

What about housing? Picture this, a 15×10 room that was filled with 2 bunk beds, 3 lockers, a dresser, and a single desk built into the wall. There are spotty wifi hotspots in a few places throughout the dorms, but the cinderblock walls prevent the signal from making it very far. You have community bathrooms that are almost never cleaned and you’re pretty sure that you can see mold growing on the ceiling above the showers. The entire complex is surrounded by a barbed wire topped fence and your bags are searched whenever you enter the complex at night. At the end of every week, a bit of money is then deducted from your paycheck for the privilege of living there. Can you guess where that is? (hint: it’s not China) That was where I lived for 2 summers as an amusement park employee. I’m not saying that the free Foxconn dorms are nicer, but from the pictures I’ve seen they sure look like they are.

This is all superficial you say? The real evil is in the work they do? Foxconn has people doing sweatshop labor, you got to work on roller coasters! The novelty of working in amusement park wears off quickly and it becomes like most other jobs, only louder. I was lucky enough to have a good job at the park (I worked on one of these) but I had a roommate who cleaned toilets. One day, I was lucky enough to work as a “sweep.” That meant I walked around all day with a broom and a dustpan sweeping up litter. More than one person asked me if I was okay because the look on my face made them think something was wrong with me. That was after ONE day of working that job. Next time you’re at an amusement park, look for those people sweeping the sidewalks. They all look just like this Foxconn employee.

But what about fair wages? Foxconn employees only make 17 dollars a day. I made $7.35 an hour. This is a pretty huge difference, but I don’t think it’s really that big when you take into account the difference in cost of living between the United States and China. (I’m not saying they’re even close, just that they’re not as far apart as the numbers say)

The United States has labor laws that prevent wages like in China though right? Sure they do, but guess who is exempt from some of them? Amusement parks! They don’t have to pay minimum wage or pay overtime. Just like amusement park employees, Foxconn employees can also be seasonal.

Now don’t get me wrong, I’m not trying to say that Foxconn is some great place to work, or the amusement park where I worked was that terrible (I did go back after all). I just wanted to give people a little bit different perspective and show them that things might not be as bad as they seem.

Posted in Uncategorized | Tagged , | Leave a comment

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 , , , | Leave a 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 | 5 Comments