Archive

Author Archive

Switching from Basic to xAuth with mgtwitterengine on iPhone

July 29th, 2010

I should preface this article by saying that I’ve consumed hundreds of code tutorials and walkthroughs – this is my first attempt to give back to the massive online library of free help. Also, I’ve never used git so I just zipped up the source and such instead of posting it on github. Hope you all enjoy it.

Background
I’m the technical co-founder of Sound Around. We make an online iphone app builder that lets bands and live performers create and manage their own custom iPhone applications. One of the features in the band’s app is to let the fans share out songs, news, shows, pics, etc, on twitter in just a couple clicks. All we use mgtwitterengine for is logging in, posting tweets, checking follow status and initiating following – your mileage may vary based on how extensively you use mgtwitterengine. Twitter will be shutting off Basic authentication soon, so I needed to venture out and implement xAuth and rebuild/resubmit all of our applications to apple to avoid the OAuthocalypse.

Step 1: Request xAuth permission from the API team at twitter

I simply sent a detailed message to api@twitter.com with my company information and intent to use xAuth. It took them 16 hours to get back to me with no questions asked. Not bad with a deadline so quickly approaching! http://dev.twitter.com/pages/xauth

Step 2: Get my stripped iPhone mgtwitterengine with xauth

This was the confusing part for me. The latest bleeding edge of mgtwitterengine on github had a lot of added fluff that I didn’t need for my iPhone project. There was added YAJL items and support for MAC OS X which just wasn’t necessary and was causing compile issues. I decided to strip all of that out and just include the files that were needed for the iPhone to be functional. Additionally, I picked up OAuthConsumer from http://github.com/jdg/oauthconsumer and dropped it into the project.

Download: http://com.soundaround.web.misc.s3.amazonaws.com/mgtwitterengine.zip

NOTE: I’m using MGTwitterEngine built as a static library that I compile as a dependency of my main project. You’ll need to look elsewhere for a tutorial on how to do that, or you can just copy the “Classes” source files into your project. The mgtwitterengine project from the zip file should build on its own with a couple warnings (not sure what from, didnt seem important to me)

Step 3: set your consumer key and consumer secret after instantiating your mgtwitterengine instance

Here is my code that gets called when my app launches. I have a single instance of mgtwitterengine that the whole app uses. Your key and secret will be available on your app profile page.

self.m_twitterEngine = [[[MGTwitterEngine alloc] initWithDelegate:self] autorelease];
[self.m_twitterEngine setConsumerKey:@"your_key" secret:@"your_secret"];

Step 4: modify your “checkUserCredentials” type of function to use the new getXAuthAccessTokenForUsername function

This is the bread and butter “login” check for the credentials provided by your users. It will return an NSString identifier like all other requests do – good idea to store this value for later checking in delegate methods. I also store the username and a UISwitch value for if they want us to remember their login (and auto-login their account next time the app launches). Yours may vary but it should have some variant of what I have below.

- (void)initiateCredentialCheckWithUsername:(NSString*)_username password:(NSString*)_password remember:(BOOL)_remember {
    self.m_authenticateRequest = [self.m_twitterEngine getXAuthAccessTokenForUsername:_username password:_password];
    self.m_remember = _remember;
    self.m_username = _username;
}

Step 5: modify your delegate file to handle new “successful authentication” call

Your current delegate method should already have a mechanism to handle failed login. Now that you’re using xAuth, the handling for failed logins wont change at all. What does change, however, is the sequence of events on a successful login.

In the event of a successful login, two delegate methods will be called (not sure if they’re called in order, or if its deterministic at all). You’ll get a normal requestSucceeded callback, but you’ll also get a call to accessTokenReceived with an argument containing your access token that will be used for all subsequent requests. I put all of my “successful login” code in the latter method since it will only be called upon a successful authentication challenge, plus it has the cool token that you need to feed to your mgtwitterengine object.

- (void)accessTokenReceived:(OAToken *)token forRequest:(NSString *)connectionIdentifier {
    self.m_accessToken = token;
    [self.m_twitterEngine setAccessToken:self.m_accessToken];
   
    self.m_authenticateRequest = nil;
    self.m_authenticated = YES;
   
    if(self.m_remember)
        [self saveLoginCredentials];
   
    //kick off the request to check if they’re following the band
    [self initiateFollowStatusCheck];
   
    //NSLog(@"TWITTER: authenticate success", requestIdentifier);
    [[NSNotificationCenter defaultCenter] postNotificationName:@"twitter_login_success" object:@"twitter"];
}

The only important part of the above code is that you set the access token for your mgtwitterengine object. Whatever else you wish to do in this method is optional.

[self.m_twitterEngine setAccessToken:self.m_accessToken];

Step 6: put in mechanisms to save the token and recall it on app launch

Once you receive the token, the OAToken class has a built-in method that you can use to save it to NSUserDefaults. The following code snippet is the body of my [self saveLoginCredentials] that you see above after I successfully receive the token. Note that service provider name and prefix are strings that you can set to whatever you want.

[[NSUserDefaults standardUserDefaults] setObject:self.m_username forKey:@"twitter_username"];
[self.m_accessToken storeInUserDefaultsWithServiceProviderName:@"soundaround" prefix:@"token"];
[[NSUserDefaults standardUserDefaults] synchronize];

Now, on program init, we can check to see if NSUserDefaults has a token for us to use based on the provider and prefix strings we used to save it. Here is my init function that sets up my twitter stuff. You’ll notice that if I find a token via NSUserDefaults, I “trick” the class by manually calling the delegate method with the retrieved token as if we had received it from an authentication challenge – this allows the rest of the “successful login” code to execute as if they had entered their user credentials again.

- (id)init {
    if(self = [super init]) {
        self.m_twitterEngine = [[[MGTwitterEngine alloc] initWithDelegate:self] autorelease];
        [self.m_twitterEngine setConsumerKey:@"your_key" secret:@"your_secret"];
       
        self.m_accessToken = [[OAToken alloc] initWithUserDefaultsUsingServiceProviderName:@"soundaround" prefix:@"token"];
        if(self.m_accessToken != nil) {
            //token successfully restored, pull the username from user defaults
            self.m_username = [[NSUserDefaults standardUserDefaults] valueForKey:@"twitter_username"];
           
            //simulate received token as authentication
            self.m_authenticateRequest = @"shirley";
            [self accessTokenReceived:self.m_accessToken forRequest:self.m_authenticateRequest];
           
            //NSLog(@"TWITTER: restored username:%@", self.m_username);
        }
       
        return self;
    }
   
    return nil;
}

And, to be nice, destroy the token when they want to logout of their account.

[OAToken removeFromUserDefaultsWithServiceProviderName:@"soundaround" prefix:@"token"];

Conclusion

I hope this lets you focus what you needed to get your iPhone project running. Please tweet this article if it was helpful for you and link back to http://www.getsoundaround.com to help plug our company.

Also, we’re looking for another technical co-founder if you’re a rockstar ((Android || iPhone) && LAMP) programmer and want to get in on an equity basis. Email me at scott@getsoundaround.com

Author: scott Categories: Code Tags: , , ,

Why 100 Hours per Week Works for Me

July 6th, 2010

I’ve been reading a lot about this lately – the whole work/life balance and how it affects health and relationships.

Mainly, I’m interested in productivity.

ANSWER: 100 hours per week works for me…but only right now.

The common fallacy I see in discussion of productivity for 50 vs 80 vs 120 hours per week to work is that it fails to mention enough context around what you’re doing for those hours. Studies usually site established corporations or other entities with revenue, a solid baseline product, and non-trivial new feature development.

Most people arguing in favor of 100 hours per week are probably like me.

This is my first software startup. We have me plus my co-founder, very little revenue, and work out of our apartment. There is a lot of low hanging fruit. There is a large amount of low hanging fruit. There is a tremendous amount of low hanging fruit. Product development, customer service, business development, many of these things can be done groggy at 5am probably with roughly similar quality as at the high point in the day. Things just have to get done and they take non-zero time to get them done.

In the future, this absolutely won’t be the case. In fact, it’s transitioning away from it now that we’ve just launched and have to really start buckling down to prioritize our time and make sure we’re going to be able to reach ramen profitability in as short as possible. New features on the development roadmap are definitely non-trivial and won’t stand up to only 5 hours a night of sleeping.

Bottom line, lets compare apples to apples when talking about productivity.

Author: scott Categories: Uncategorized Tags:

Don’t Filter the Advice You Get, Filter the Advisors

May 9th, 2010

One of the common pitfalls that I think people run into when starting a company is asking everyone what they think about their product, what features they should add/remove, what segment of their market they should target, how to advertise and gain customers, etc.  This exercise is good if you’re having conversation with somebody at a bar – “so what do you do?” – but on the whole I’ve found it to be mainly a waste of time to be seeking out anyone and everyone to talk about your product to.

Unfortunately, it takes learning the hard way to find this out for a couple of reasons:

  • The media loves and glorifies the headstrong, stalwart leader for defying the common consensus and going it alone because they are made out to be some “visionary” or “prodigy” for finding the next thing. Starters tend to think that the more they get shot down the more they’re “defying the odds”. Go talk to Jeff Bezos, Ron Conway, Jeff Clavier, and, just for shits and giggles, go ask Jason Calacanis what he thinks – these people are a much better barometer for your web or technology startup than Grandma, creepy Uncle Tony, and the hipster who frequents your local coffee shop couch.
  • You realize that the common questions you receive aren’t asked by the smartest of angels, VCs, and advisors.  I hate getting asked “Do you have anything you can patent” or “what % of this market can you catch” or “how will you market your product” or “what if Google decides to do this”.  The answer to all of those is “I don’t know and I’m not going to waste time guessing”.  Really finding the answer to those things is done when you have a product and are able to measure the actual customer response
  • People try to give you advice based on their own experience which, not surprisingly, isn’t at all applicable to what you’re doing.  If you’re building a SaaS web app for graphic designers and run across Andy Bernard, Andy Bernard will probably start talking about his sales cycle in a B2B setting for inkjet printers and reams of paper.  He may or may not try to tie it back to your business, almost assuredly unsuccesfully.  Andy Bernard is the wrong person to ask or solicit advice for about your business.

So, what can you do about this?  I’ve come up with a few guidelines that I’ve kept in my head about what I try to do to filter the advice coming in.  More importantly, you should be establishing criteria for the people you seek out to have coffee with, get to invest in your company, see your early product releases, etc.

  • Avoid large market association.  Not only do people not understand your product in the first couple minutes, their previous college roommates will likely have no association either.  ”Ya that sounds cool, my roommate in college used to work with websites and he just bought a sweet Toyota Yaris with all the money he’s made.”.  Unless he’s done a SaaS business before, or built a product for graphic designers, or is a graphic designer, chances are his “expert” or “experienced” feedback is going to go in the garbage can along with what your “analyst” rich neighbor said as well.
  • Previous success is not a bellwether for future success or awareness of their surroundings.  Steve Jobs ran Pixar and is running Apple like a banshee.  Put him in the context of Soy Bean farming and there is ZERO guarantee he’ll do well.  Your own experience and market familiarity is likely going to be more valuable than feedback from even the most successful people you’ll meet.
  • Business veterans often miss huge opportunities.  I was reading an article on RWW about famous people ignoring advice given to them, and the common denominator seemed to be entrenchment having a positive correlation with rejection of revolutionary new ideas.  For my 23 years of being alive, things have yet to cool off on the “change” horizon with the internet – I don’t predict this to stop.  The better people to talk to are the people who have been in your market long enough to understand the driving core principles, but also can entertain earth shattering ideas that may flip the industry upside down.
  • Stop asking stupid questions.  ”What should I do about problem X” isn’t going to get you a great response, neither is “What is the future of market Y?”.  I’ve found that advisors are like beta testers – they work much better when you tell them what you’re doing and solicit feedback.  ”I have this problem X, and I’m thinking we could solve it with A, B, or C” – having your 3 most thought-out possible solutions will open the floodgates for response because the context around your problem is embedded in what YOU as the owner are thinking would be good ways to solve it.
  • Recognize the difference between and advisor and a cheerleader.  Some people are going to be overly excited about your product because they like you and want to see you succeed – your Mom and Grandma are good examples.  Anything you bring to them about what you’re building next or some cool new feature you developed will obviously make them go “honey this is wonderful!”.  Other entrepreneurs are most likely going to be cheerleaders; people you can talk to when you’re stressed and have a lonely job being at the top.  They’ve been through it before and their message of “there’s light at the end of the tunnel, keep pushing” is worth Gold when you’re in a slump or need some encouragement if things aren’t going as well as you’d hoped.  Advisors will be very honest with you if they think you’re making a mistake or aren’t seizing opportunities fast enough.  Don’t confuse cheerleaders with advisors just to feel better about your product.

Any suggestions or stories are more than welcome.  I’d like to see hear about what others are experiencing and how they’re keeping a good filter on.

Author: scott Categories: Entrepreneurship, Web, networking Tags:

Oh, but you worked hard on it? I don’t care.

April 24th, 2010

I feel like I’ve been misled over the past 8 years of formal education that I’ve been a part of.  I don’t know if the education system or American culture is to blame, but there seems to be this permeating school of thought that may be a large contributor to the unemployment numbers we’re seeing today.  And, incidentally, this was a revelation to me in that I finally nailed down why entrepreneurship is so hard.  The answer, as usual, is pretty simple…

Society doesn’t care how hard you work. If you don’t produce anything of value that they’re willing to spend money on, it is your loss. The amount of invested time, money, blood, sweat, and tears only matter in your own eyes at the end of the day. Consumers reward the smartest workers, not the hardest workers; and if you think you can work at something for a little while just to sit back and take in the cash you’re sorely mistaken.

The grade school and corporation frame of mind tell us that if we try hard or if we do as our boss tells us enough to not get fired that we deserve that paycheck every Friday.  Obviously, this is exactly the opposite of how people spend their money, and people with their own companies will tell you first hand that you ask yourself every day if what you’re making is going to provide enough value.  Not only that, even those that have launched successful products still have to be on the leading edge to stay afloat.  ”Trying” on my calculus homework didn’t get me nearer to coming up with revolutionary solar technology or cars that drive themselves, but my grade told me that it did.  People take pride at staying late on a Friday to cap off that 60 hour week, as if their team got the benefit of having 1.5 employees for just 1 salary – highly misleading.

Try asking your boss if you can work on something that will provide more value to your customers.  See what they say.

Author: scott Categories: Uncategorized Tags:

iPad First Impressions

April 20th, 2010

I haven’t had time to sit down one-on-one with an iPad until about an hour ago.  Luckily for me, NCSU’s library bought a bunch of them and are loaning them out to students for free.  This was especially good because it comes without the promo software that the devices in the store have, and it wasn’t a friend’s personal device. Long story short, I could have my way with it and not feel guilty (or get arrested).

In the lead up to the iPad, Apple did its thing pimping the App Store as much as humanly possible – they even went as far as to make the iPad backward compatible with all existing iPhone applications.  You could even run them in “double pixel” mode to get it to run full screen.  Although this sounds great in theory, it was not at all what I had hoped for in terms of Apple-esque delivery.  On the contrary, the apps built specifically for iPad – 3rd party and by Apple – were fantastic in their visual experience and supreme leverage of the newfound touch screen real estate.  Observations are below.

Good

  • SDK additions for new layout and program flow: the split column and “large view pane with small bar on side” approach both make for great experience with a large area for the important stuff and your necessary navigation always available.  Pandora was fantastic, as was YouTube and other items like Settings and Address Book
  • Responsiveness: rotation, touch, swipe and pinch, everything worked well and worked more snappy than the 3GS.  Moving from an iPhone 2G to and iPhone 3GS yielded amazing results in overall experience – Apple has continued that with the iPad.
  • Gaming: I played one game called Aurora Feint for about 5 minutes and was absolutely enthralled.  Hats off to the game developer of course, but there’s something to be said about the iPad fitting into a nice form factor with 100% touch screen.  Throw in stunning graphics and headphones and it’s a very inclusive gaming experience equal to that of a desktop computer.  If I ever get back into gaming it may just be on the iPad.

Bad

  • Typing: I’m not sure if I’ve yet to figure this out, but I now have iPhone and iPad both on my S-list for typing.  I’m still at the library and the kid across from me is typing like a fiend as if his iPad were a keyboard.  No clue how well he’s doing, but the lack of tactile response just plain sucked for me.  The sad part is that I don’t know how or even if this will be remedied anytime soon – we may be seeing the raw limitations of efficient human input.
  • Running iPhone-only apps: this just plain sucked as well.  It’s literally a (double-pixel)-ing done with software with no sense of what/where text is, attempt at graphics interpolation, etc.  They seem to have done it just say that “out of the box this thing runs 200,000 apps”.  I’m not surprised, just upset that it was way oversold.  Also, MapKit is broke in the Transloc App.  Hopefully we’ll want to buy an iPad to fix this…
  • Ergonomics: it’s cumbersome to hold.  My only advice is to sit somewhere that you can prop your feet up with your knees highest in the air and rest it on your legs.  I was able to have it rest part on my legs and part on the edge of the table that I’m at to form a pretty little 45 degree angle.  My neck started to hurt after a little bit so I laid it flat on the table to use it after that.

That is all.  I may buy one when the 3G version comes out in order to assess what we want to do with it in terms of Sound Around.  My biggest interest, though, is how much of a development machine (or tool) I can turn it into.  iPhone has been out for 3 years and hasn’t come up with anything to take the developer community by storm – I’m not going to make the same judgement for the iPad just yet.

Author: scott Categories: Reviews Tags: , , ,

The Entrepreneur’s Conundrum – Personal Consumerism

April 12th, 2010

The past 9 months – especially the last 4 – have taught me a lot about how much of a lifestyle doing startups is.  In particular, the time and emotional requirements are enough to make even the most “hard working” techies flee back to their comfy IBM cubicle.  One unfortunate side effect of this time commitment is my gradual removal from needing to entertain myself or “kill time” – it just doesn’t happen anymore.  There’s way too much to do to be bored.  And, even for those times where I do need a break to be entertained, I’m doing something productive with people or a book – I’m not buying “things”.

Girls buy shoes and clothes, guys buy video games and lifted trucks, people who start companies bring sandwiches to their part time jobs so they can keep the development server up and running.  This removal from personal consumerism can be somewhat discouraging in so far as we’ll “miss the boat” or become too “disconnected” with how people are behaving and what trends the dollars are moving toward.  Just because I find entertainment in working on my company doesn’t mean that others will, in fact most of them don’t.  Also, my lack of consumerism doesn’t take away from the entertainment value provided by entrepreneurs like myself that are working toward providing something that the world will enjoy.  Regardless, my job is to figure out how to be enough of a participant to stay relevant, but be enough removed that I can effectively stay focused.

Author: scott Categories: Uncategorized Tags:

Reflections on Boulder

March 7th, 2010

I loved Boulder. Steve loved Boulder. Boulder is amazing. End of story.

This weekend was an absolute whirlwind of “data” points about our idea, the target market, team dynamics, future of the product – we talked about it all. We talked about it all with some of the brightest minds we’ve met to date. Raleigh isn’t necessarily a breeding ground for software startup people; you can imagine our fascination with the warm tech scene that Boulder had to offer. They just get it.

We talked to a lot of teams at techstars for a day. Outside of the event the conversation was all with techstars grads and other people in the area recommended to us by these previous grads – mentors and locals who are heavily involved in the startup process. Their feedback was candid and very much appropriate for our situation and our outlook moving forward.

Our conclusion? We need to pivot.  Whether we pivot some or pivot completely is still up in the air, but the writing on the wall as we saw it this weekend is more than enough evidence for us to do some due diligence to switch gears.  We’ll continue to surround ourselves with people much smarter than us and make the most informed decision before we go back to flying by the seat of our pants.

Big thanks to everyone at Techstars and in Boulder who helped us out – Next Big Sound (David, Alex, Samir, Eric), Micah Baldwin, Ben Brinckerhoff, Tom Higley, Jason Mendelson, Seth Levine, David Cohen, Nicole Glaros (congrats on the baby!), Rob LaFave, and everyone else we met in passing.  You all left a great impression on us and are solid recruiters for keeping Boulder alive and thriving.

Author: scott Categories: Entrepreneurship Tags:

Techstars for a Day

February 21st, 2010

The awesome people over at Techstars just sent us an invite to come to Techstars for a Day in March!  We’ll be flying out on Thursday the 4th and staying through Sunday.  Big thanks to the people at Next Big Sound for agreeing to house us for the nights that we will be there – always appreciate being able to sleep on a floor if we don’t have to pay for hotel costs.  They seem like awesome guys and should be great resources for information about Boulder, Techstars, and being in a music startup.

On that note, if anyone finds it in their Giri to donate money to help offset the cost of plane tickets, we would gladly put up a huge plug for all 12 of our blog readers to see.

Also, if anyone reading this is also attending TSFAD, send me an email at scott@getsoundaround.com so that we can hook up while in Boulder for coffee.  I’d love to have a packed schedule while we’re there doing as much networking as possible.

See you in March.

Author: scott Categories: Uncategorized Tags:

Spring Break in Silicon Valley

February 17th, 2010

It’s official! Were both headed to spring break in Silicon Valley with EEP. Although I was out there in October to hang with the MyFit crew, it’ll be great to go back for another 5 days of entrepreneury goodness as we get to tour Palo Alto and Sand Hill Road (if we must…), see the Google and Apple campuses, possibly meet Randy Komisar and Guy Kawasaki and hopefully Steve Blank, the list goes on and on. Best of all, NCSU heavily subsidizes the trip such that the 5 days of airfair, food, and lodging only costs $300.

We’re still waiting on a lineup of who we are definitely going to visit. I’ll try to post an update when I get it.

Also, i’ll be doing the local tour here as part of a joint venture between NCSU and Southern Capitol Ventures (thanks to Jason Caplain for hosting the trip each semester). We’re set to hit canvas on demand, iContact, and a few more. These are always fun to do. Any time you see a founder’s eyes light up telling you their story, something powerful happens in the surfacing of emotions and harnessing of energy to add even more fuel to my business drive.

Author: scott Categories: Entrepreneurship Tags:

A Letter to University Entrepreneurship Program Teachers and Administrators

February 14th, 2010

You’ve almost certainly been in our situation before. Were chomping at the bit to get as much of our company up and running before the paycheck from mom and dad and the govt stops coming. Classes are now not only a serious burden to our drinking habit, but are a serious threat to the amount of time we have to spend coding or talking to potential clients. If only the world knew what they had coming for them they surely would all chip in and help us buy our last semester grades and fast food for every meal so that we wouldn’t have to waste 3 minutes cooking hot dogs for every meal. I give you this imagery because I want for you to reminisce on these days of lore and remember how gloriously poor you(we) were(are) in terms of money, cofounders, and hours in the day.

One of the most challenging quandrys that university student entrepreneurs face is the realization that they’ve more or less transcended what the university has to offer them. The academic content isn’t necessarily dry or inapplicable to all bottom-line-driven companies, it’s just that they don’t make classes specifically geared toward YOUR startup. If they offered a degree in Sound Around I would be there all day every paying attention and taking notes. The reality, however, is that generalized classes rarely provide knowledge directly applicable to obtaining our minimum viable product.

Here is where things get sticky. You, as an administrator, have a contract to uphold where you are bound by the university to correctly facilitate the pedogogical value in entrepreneurship teaching and mentorship. We are bound by our drive to get our company to a state where it is making both money and meaning in the world.  These two positions OFTEN have maligned objectives and goals.

From a student perspective here is my advice: if these types of students are enrolled in your entrepreneurship class, there is most likely nothing you can do to reign them in back to the class level. They are beyond the point of being driven by grades. As long as their behavior is not totally detrimental to the program just let them do their thing. There are other students that need the mentoring and attention.  Fighting a frivolous battle with driven entrepreneurs will take away significantly from the other 90% of the entrepreneurship students still finding their legs.  Additionally, working WITH students will ultimately help your university and the university system as a whole in its ability to bring talented individuals together to spawn the next google or facebook.

The university should be seen as a leverage point for entrepreneurs, not a hindrance to their overwhelming desire to start something great.