Working With Social Network APIs

Creating Vicinity Buzz naturally involved working with a the APIs of social networks. That information seemed worth sharing for those of you interested in writing any type of application that would integrate with a social network.

Developer Documentation

Any of the social networking sites you probably want to integrate with have developer api’s that are well documented. Here’s the starting points for a variety of services:

Working With JSON

All of these APIs are best used with JSON. If you’re not familiar, you can read up at json.org. It’s the notation for serialization of javascript objects, and object literals.

Where To Make the Call From

If you are working in a standard web page, you could call the api from document.ready (assuming you are using jquery). This is the approach I take on hoolihan.net, my personal homepage. There is a twitter feed on the right side.

If you have a bit more of an application, you may want to look at one of the many javascript frameworks that help you route events to actions. These are frameworks like backbone, knockout, spine, etc. There are also commercial variants like kendo, dojo, and sencha.

jQueryMobile is commonly paired with PhoneGap, and in that scenario, using something like backbone is a bit tricky. You may want to bring in a template binding library, but avoid routing.

Binding

jQuery.templates was one of the first good javascript template binders that I’m aware of, but there are now many different options. In the jQuery world, most of the momentum seems aimed at jsrender. Recently I’ve considered bring in knockout and only using the binding part, but I’m not far enough in to evaluate that direction.

API Keys

Unless you’re using the most basic parts of the API, you’ll probably need to register your app and get an API key. It’s a token that identifies your application. In the event of API abuse (too many calls, etc), they have information to contact you and analytics around the issue.

Open Authentication

This is a big topic, but if your application wants to use a social network to identify your users, this is possible via open authentication. If you are interested in this, get started here.

What Do You Think?

Are there any particular areas of the APIs that you’d like to see more detail about? Any conceptual parts that would warrant their own post? Let me know what you think below.

Lessons of a Failed Startup(s)

A couple of months ago, I finished reading Eric Ries’ The Lean Startup. It got me to thinking about startups and small projects I’ve been a part of in the past.

In particular, I think of a social site for readers that I was apart of that failed. I think of the the end, where I was trying to make the case to launch something and let users drive the feature list. What I find really frustrating is that I did such a poor job of communicating that at the time. Reading the book, I hear a much better way of emphasizing the point of customer feedback loops. The minimum viable product with hypothesis and user testing driving the next steps; it has so much value. Additionally, that movement has a number of successful followers to their name, so they have credibility with their message. Timing and other market factors may have doomed us anyway, but I can’t help but thinking of what could have been different armed with some of that information at the time.

The other part of the book that really resonates with me is how hard successful startups are. People are so afraid of there idea being stolen. In the book, Eric Ries suggests that you try to have someone steal your idea (it’s hard to do). He’s right. If someone actually wants to steal your idea, at least it validates that other people think it’s a good idea.

I get approached by people with startup ideas a lot, looking for programmers who want to work for equity. For young developers with the time, I think they should get involved, it’s a great way to learn the realities of business and to get some extra experience. But beware of how much of a longshot it is to get the product successfully to market. It has to be a good idea, successfully built, successfully marketed, and fill a timely need. Miss any of those categories, and you probably won’t do much.

I’m not suggesting people avoid startups. They are a great learning experience and some of them work out. But go in with your eyes open to the amount of work you have in front of you. And be discriminatory about where you choose to invest your time. Are the others involved willing to put in the same effort you are? Will this new organization be capable of all of the things needed to be done to launch a product?

My advice for evaluating an idea: run a set of books for the project (meaning keep accounting). If you’re working for equity, keep track of time anyway and what you could have been paid at your regular rate to do that work. How long will it take for the project to pay that back? That question opens a lot of eyes. Say what you will about money as a measuring tool, but it’s the standard for all projects and companies. It’s relatively objective, and very compatible with math. The same can’t be said of a subjective goal like “let’s take over the XYZ market.” Presumably, you have your day job because you make someone more money than you cost them. If you can’t say the same of your startup project within the first year, then your project doesn’t even have the ROI of your “boring old day job” (you may love your job, my point here is that people thing of startups as high risk / high ROI and that may not be the case). Every time you sit down to put more into the project, you’re saying that you will get that back in cash on the other end. Is that true, or are you kidding yourself?

There can be other reasons to do a startup. I’ll use a personal recent example. I built VicinityBuzz, and iOS application around Social geo-search (also coming soon to Android and WP7). It’s been slow out of the gate so far, but I’m hopeful that some of the new features coming in the next update and some marketing ideas I have will help. Regardless, I’m certainly a long way from paying myself back for the time I put in. But I have been working in cutting edge technologies more and mobile is a real focus. I knew even if the project never paid for itself that it was valuable time learning and to put the project into my portfolio of work. I went in with those realistic expectations, but try really hard to exceed them.

If there is intended to be a single message of this post, it is to apply measurable goals to your projects, and evaluate and pivot your direction as often as reasonbale. If I had to boil down the message of the book to one sentence, that would be it.

VicinityBuzz: Writing A Mobile App

This post is intended to go through the process of writing and publishing an app. It will be a high-level introduction. The idea is that future posts that will dig into specific topics in depth. This post will be updated to link to those future posts as an index of mobile development topics. The app I’m describing is VicinityBuzz and it’s available here.

Product Vision

While I had been thinking about writing a mobile application for a while, I needed an idea to stick with to completion. The app stores are relatively young, but they are fairly saturated, and bringing something new to the table was a challenge. Recently I read Eric Ries’ The Lean Startup and I do like the idea of MVP(Minimum Viable Product), so I didn’t feel the need to have a telephone book of requirements. I was just looking to have an original idea for the app stores.

In the case of VicinityBuzz, I have always felt that there are not enough good ways to search social media, particularly by location. There are social media sites like FourSquare solely dedicated to location, but I’m referring to something else. Using networks where content is the reason (not location) but by location. For instance, at a conference, users often hashtag their tweets with the name of the conference. But not always. And the hashtag will draw attention from people not at the conference. That’s fine, and there can be useful conversation by just using the hashtag, but what if I want to see posts of all users that are actually at the location.

app screenshot

This is particularly true of news events. On the day of the shootings at Chardon High School, I used the application to see what students and families in the area were posting about. They were each telling their own version of the story. It was heartbreaking and much more informative and up to date than the news being released to the public. Hashtags were useless in this case, for two reasons. First, the students weren’t hashtagging their posts, they didn’t need to. They were posting to their real-life friends and thus already connected on twitter. Second, the tag was full of a lot of the reaction from the public around the globe. That was interesting too, but it wasn’t was I looking for. I wanted facts and eye-witness accounts. It was like CNN’s iReport, but on steroids.

Platform Selection

Native or not? As a web developer, I chose PhoneGap. It’s a mobile platform framework that uses html and JavaScript, which are skills I already have. And the application didn’t have very many device needs that would require native access. GPS is the only device call I make, and that is easily accessible from the PhoneGap JavaScript API. I knew it would be faster than for me to learn the ins and outs of the Cocoa framework and Objective-C, although I am in the process of doing that now for future apps. I have written some small applications in the native iOS sdk, and even paired with some developers to help bootstrap their iOS work, but I just didn’t feel comfortable writing an app consumable by the general public yet. Along with PhoneGap, I’m using jQuery mobile.

Essentially PhoneGap provides project templates for your platform (Android, iOS, WP7, and more) that create a shell of an application that hosts a browser control. All of your files go in a directory (like resources) and get loaded up by the browser control.

app screenshot featuring controls

Using PhoneGap gives me a version that is easily ported to Android and WinPhone 7. Although those markets lag Apple’s AppStore in terms of developer revenue, I want to cast the widest net possible with this application for obvious financial reasons, and also to learn. The more feedback I can get on the application, the better I can make it.

At some point I may go ahead and do a native rewrite. But for now, I’m very happy with what is possible in PhoneGap and jQuery mobile.

Prototyping

I started development with jQuery UI in a browser. Using the built in JavaScript debugger in Chrome was easy. Note you could just as easily use Firebug in Firefox, or the IE Developer tools. Once I was satisfied with functionality, I swapped jQuery mobile in place of jQuery UI and moved the app into the PhoneGap container. More on that in the next section.

One note: If I had to do this over again, I would have simply started with jQuery mobile. It’s not that hard to get started with as the docs are great, and it’s best to just start down that path.

App Store Submission

Thus far, I can only speak to the Apple Store submission process. After going through the steps provisioning portal, it was fairly easy to test the app on a device. In order to submit to Apple, you then create a profile for the application (screenshots, contracts, payment details, etc) and submit a signed binary to Apple for review. The process of signing a binary for release can be a little tricky, but the walk-through on Apple’s developer portal helps a lot.

One thing to note: Apple requires you have a support page. I stole an idea from the Trello folks, and used a public trello board for this purpose. It took less than 5 minutes to setup.

Marketing

I created a basic web page with a description of the application. Apple has a page for making the link to their store. If you are interested in opening the store automatically, either see the options in this stackoverflow post, or add the query paramter “ls=1” to the url you get from the link maker.

What’s Next?

Apple just announced “the new iPad” so I have to do some updating to support that. I haven’t read the new docs, but I assume this means a high-res iPad splash screen and icon. All of my other assets are web assets and scale accordingly.

My next steps are to add a simpler user workflow, a refresh button to update your current search, and add some social networks like Facebook and Instagram.

After that, I’m going to start porting to Android and WinPhone 7. Since the application is already written, it should be as simple as getting a PhoneGap project running for each environment. I have also considered the Mac App Store and the upcoming Win 8 Marketplace for desktop application versions.

Finally, I’ll blog more in depth about some of the topics covered, and provide links to those posts on this page. Mobile development is rewarding, but can be challenging for those coming from a web or desktop background. I’d like to pass on some of the things I learned so that others working in mobile can save some time.

Feel free to provide feedback and questions if you have something in particular you’d like me to cover. And checkout the application!

On Commuting and The Economy

Yesterday, I left downtown Cleveland at 3:45 headed to a 4 o’clock meeting. I was probably going to be 5-10 minutes late. Instead I ended up calling to reschedule, and still didn’t make it home till 6:15. Two and half hours, for a drive that usually takes me 45-55 minutes. Google maps says 38 minutes, but that’s not realistic on a weekday. As I was virtually at a standstill on I-77, and I saw some helicopters coming and going, I assume this was a very bad day for someone up ahead, and so as frustrating as the experience is, delaying my day (and many others) is a small price for life saving flights to the hospital.

But the traffic did get me to thinking, that most traffic jams are a multifaceted problem. I’m referring to those simply caused by congestion, fender-benders, or traffic stops (and the associated gawking). Wikipedia does a nice job of listing the negative effects. But I think in the current context of the US today, it’s worse than what they list. And I think we have the power to mitigate some of this.

As already mentioned in the Wikipedia list, there is opportunity cost, massive pollution increase, and psychological effects to traffic problem. What about our current time period makes this worse? Try the housing market. How? Workers commuting a long distance wanting to avoid the risks of long traffic tie-ups aren’t nearly as free to move closer to their jobs. Or they aren’t looking at far away jobs merely because of the commute. The tie-in between housing (mobility of workers) and jobs is clear, add urban congestion to that fire. Also, construction and maintenance projects that can make for better commutes aren’t exactly popular, particularly when tied to state and local budgets. Unlike the Federal Government, these state and local entities can’t run large deficits during times of tax revenue decline. Finally, consider the wasted fuel (which is getting more expensive with turmoil in the Middle East) and it’s effects on household budgets that are already stressed thin.

So what remedies exist?

The White House has been pushing for high speed rail projects across the country, but some states have turned the money down fearing the investment they would have to put with it. There are a lot of questions about the value, but it’s hard to imagine that making people more fluid is a bad thing for commute times and the job market. With this in mind, I asked a question about the speed of Ohio’s rail on quora.com.

Telecommuting has gained a lot of momentum, although I expect there has been some reduction during the recession (office space is not as much of an issue with a contracting workforce). While I’ve never been a big fan of working from home, it’s clear that it can save both the individual and company time and dollars.

GPS Systems are increasingly integrating traffic data. Just like emissions standards, having smart traffic systems as mandatory in cars could go a long way to assist in intelligent rerouting of commuters in the event of a backup. How many times have you been in a traffic jam and felt like you were rolling the dice when deciding whether to get off the highway and try another way? There are even social GPS systems like Waze that attempt to address this.

Google has been working on driver-less cars for a while now. Certainly safety, reliability and such are an early concern during testing. Once refined and proven, however, this technology would drastically reduce accidents, traffic stops, and save lives. If everyone were driving such cars (this is a loooong way out), speed limits could be drastically increased with little additional safety risk.

IBM, under their Smart Planet initiative, have been researching and implementing smart traffic systems.

I can only hope that some of these advancements lead to the kind of information available to drivers that is portrayed in this video “A Day Made of Glass” by Corning.

I think the challenge is finding reasonable first steps and getting some coordination between these initiatives. Given a recession, and global competition from rising powers like China and India, the US could gain a lot output from simple efforts to improve traffic scenarios. And maybe civil engineers (specifically transportation engineers) are on top of these ideas, but for now it certainly doesn’t look like the US is leading the way with solving these issues. Even if commute times aren’t drastically reduced, with solutions like the Google car or the high speed rail, imagine the productivity increase of commuting free time with internet available. You could use the time to pay your bill, catch up on news, do correspondence course work, etc. For some commuters, this is already a reality.

Some of the stimulus money was aimed at these kinds of projects, but in my mind, not enough. The long term economic effects of a mobile workforce are undeniable. And these efforts could payoff in terms of global competition for years to come.

What do you think? Does your city have solutions or efforts under way for this? Do you see a particular effort or company leading the way with this? I see mostly efforst coming from technology companies, but are there other significant efforts to address these issues?

Networking Yourself As A Developer

In a tough economy, jobs can be hard to find. Especially the right jobs, ones that make you happy and help you grow in your career. Even if you are satisfied with your job, having a network of programmers, managers, and other IT professionals is a great thing. You have people to bounce ideas off of, and a safety net of jobs that you have a head start on should something go bad with your job or company.

Looking through the list I came up with, there is a heavy emphasis on social networks. Maybe that’s because I’m a working parent, and in-person events are hard to attend. You’ll see some on the list, but I’m not racking up frequent flyer miles going to events. But I think it also has to do with taking advantage of communities that span the globe.

Follows is what I would consider the basics of getting your name out there:

  1. Local User Groups – These are invaluable. Once a month or so, you get to learn about a new aspect of your favorite community while interacting with other members. And you can often present once you know the group, which is a great way to work on your presentation skills.
  2. A Blog – Sharing your ideas, and getting feedback is a great way to engage other developers who will take the time to read a thought out blog post. It will give you practice at clearly communicating your ideas, and processing feedback (and spam comments). Write about what interests you, and write in the style you like. For instance, Steve Yegge’s blog posts are my all-time favorites, and they are novellettes, but I write nothing like that.
  3. LinkedIn.com – It’s like facebook for your job. Sure, there are a lot of recruiters on there, and some other hassles, but it’s still a great way to keep in tough with old coworkers and keep up with what is happening in your region and field.
  4. Twitter.com – If you’re a developer and not on twitter, I’m not sure I understand why. Sure, there’s a lot of noise, but it’s like a new form of IRC. There is just so much instant sharing of good ideas, and promoting of content. For instance, I’ve gotten into quora lately (see below), and I regularly tweet out quora questions that I want more people to look at.
  5. StackOverflow.com – Yes, stackoverflow is about answering questions. But you also get to seeing the same faces answering the same types of questions, etc. Your quality and clarity of answers earns you a reputation. And what you end up building is a great resume. I regularly feel like someone could evaluate a programmer by looking through their stackoverflow profile alone. It would tell you what kinds of technologies they are comfortable in, how clearly they communicate, if they get easily drawn into arguments, and how much detail they can go into when necessary.
  6. Quora.com – Quora is new and trendy right now. It’s a Q & A site that wants it’s content to end up serving as a Wikipedia of answers. It has lofty goals, and it has drawn a fairly elite crowd so far. Similar to stackoverflow, I think there is social benefit and a resume like quality built upon your content.
  7. Facebook.com – Why facebook? It’s for soccer moms and college students, right? Most of the other communities tend to host a lot of tech people in general, and can be a bit homogenous. While facebook is the most broad representation of people I know… friends, family, old coworkers, you name it. So that’s the way I prefer to keep up with my family and friends. But it’s also a great way to stay connected about jobs, local events, and other relevant info. There are groups on there for developers, and you never know when one of your friends in another industry will have info on work relevant to you.
  8. Online User Groups – With StackOverflow getting big, I don’t find myself using user groups as often as I use to. But there are still questions that are so specific to a community, that I know I’m better off posting in a user group than on a general Q & A site like stackoverflow or quora.
  9. Regional Conferences – I’ve gone to Codemash the last two years. The presentations are great, and I’ve always come away with new ideas and interests. But I also come away with new contacts for linkedin and twitter, new reading suggestions, new acquaintances and friends, and job leads. I’m not looking for a job, but it’s great to know you have some backup plans. And when my company has been hiring, I have several times recommended people that I’ve met out in the community, and had them well received as strong candidates.
  10. Start Your Own Event – Many conferences and user groups will host open spaces, or lightening talks. They are highly interactive and you’ll have a hard time leaving without some new contacts.
  11. Vark.com – This is an interesting new service you have to try to believe. You sign up, and specifiy some topics you’ll answer questions on. Then you ask questions when you have them (preferably that are not google questions, but need a human touch), and vark will find someone to answer and get that answer back to you. I asked for a recommendation for a portrait lens for my Sony a390 DSLR camera, and got a well thought out answer with buying options. Like StackOverflow, this is a resource first and a community second, but your profile is a great way to show off your ability to communicate and explain detail.
  12. Give Camps – I haven’t been able to attend one yet, but am really hoping to this year. It’s for good causes, and you’ll meet other developers in your area from all kinds of backgrounds. What a great idea.

About the sites that involve getting and receiving help (StackOverflow, Quora, Vark), you’re probably only using the site well if you’re both asking and answering questions. Asking a well worded thoughtful question with adequate detail is as much of a skill as answering a question.

Finally, my advice would be to simplify cross-posting to these groups by integrating accounts when you can. For instance, I have linkedin and facebook set to watch my twitter account. If I post anything with the #fb hashtag, facebook picks it up and posts it as my status. Similarly, #li is picked up by linkedin. Beyond simplying the effort of getting content out, all that linking back and forth helps out your search engine traffic as well.

Happy networking…