How to build a web service in 8 hours

I was a big fan of Jaiku (here I am) and didn’t “get” Twitter until about a year ago when a friend showed me Tweetdeck. Aha! So that’s how you’re supposed to use it! Not through the web page but by using a third party tool. I got so excited that I proclaimed Twitter the future of the web.

And I stopped using Jaiku.

One thing I did miss from the Jaiku-days, though, was the long discussion threads under each “jaik” (the Jaiku version of a “tweet”). Here’s an example. This provided Jaiku with depth, something you can hardly accuse Twitter of.

So an idea emerged: what if you could build a web service that made it possible to comment and discuss each tweet just like you did in the Jaiku-days.

Thus, Discuss a Tweet was born.

Or, well, at least the domain was registered. I did this April 17 2009. It then ended up in my pile of great-ideas-I-should-one-day-implement and nothing happened.

Until… last weekend.

I knew that it would be possible to put it all together quite fast. I had used Disqus when we built Rate My Pitch during 24 hour business camp – so I knew that the commenting system, the most difficult part, I would get for “free”. I wouldn’t even need a database. It was all about putting things together in a slightly new way. A classic mashup.

So, I started hacking away. A couple of hours later, the result is a mashup of the following services:

This is just a tiny little hack but I think it serves as a good example of how modern web development is done. You pick bits and pieces from all over the web, some open source components, some embedded web services. You put things together and something new emerges.

I used PHP and this is also worth noting. People complain about PHP but one of its biggest strengths is its user base and size. When you’re doing a mashup such as Discuss a Tweet you can be sure someone else has done about the same things you need and there is code out there ready to be used. You can’t say that about Scala or Erlang regardless of how powerful and beautiful the languages are. (Things are changing of course as the popularity of the language grows.)

Another thing happened while Discuss-a-Tweet was in my idea-pool: Google Buzz launched. According to Mr Jaiku himself, Jyri Engeström, Buzz is the continuation of Jaiku. And, yes, it allows you to comment and discuss tweets.

Maybe a usage pattern is emerging in how we use different social networks. Twitter for quick news updates and cool links, Facebook for our friends and Buzz for the discussions. Maybe the Opportunity Cloud for a service such as Discuss-a-Tweet is dispersing. We’ll see. It was fun building it anyway – and it only took a few hours after all. 🙂

(PS. Follow me on Twitter.)


Mobile Development SDKs compared: MoSync, PhoneGap and AppWhirl

Ever since I started my first consultancy business back in 1998, I’ve been thinking “next year will be the Year Of Mobile”.

I’ve been wrong every year.

Of course the sales of mobile phones have been great but in terms of mobile applications and the mobile web, things were more or less stuck in black & white text mode. But, the last couple or years, things have finally started to change – and change fast!

So, it is a very good time to get in to mobile development. This is like the early days of the web all over again. Opportunities are plenty! Before you know it, every company will want a mobile application to accompany their social web site. If you don’t know mobile yet, now is the time to start learning.

The obvious first question is: where do I start?

There are many mobile development tools out there. This blog post is a little deeper look in to three different approaches that will give you an app running in less than an hour.

By far the simplest approach is taken by tools such as AppWhirl. This is an online tool that generates a complete application for you. Not only that, it sends the app to the Apple App Store for approval. That’s right, AppWhirl is only for iPhone.

It is also extremely limited in that you can only generate apps from existing RSS feeds, making it less of an application toolkit and more of a mobile RSS reader-generator. Nothing wrong with that, you just need to be aware of the limitations.

AppWhirl is:

  • Extremely simple to use – anyone can generate an application with this tool.
  • Extremely limited – this is not an application SDK but a very simple way to publish your RSS feed as an application.
  • Only supports iPhone.

PhoneGap is far more advanced. This is how they describe themselves:

PhoneGap is a development tool that allows web developers to take advantage of the core features in the iPhone, Android, BlackBerry, and Symbian with a unified JavaScript API.

Now, while PhoneGap is a cross platform tool, the development process and setup is slightly different for the different platforms. You need to install all the different SDKs to fully use this tool. This can be quite a hassle.

What is PhoneGap? It’s basically a bridge that enables Javascript to call native functionality not normally accessible to a web page running in a browser. It does this by packaging the PhoneGap framework, your HTML/CSS/JavaScript-files and a magic JavaScript-file called “phonegap.js” in an application package. It then uses the built in browser component to render the “pages” of the app.

This means if you’re used to web development you will be up and running quickly on PhoneGap. It also means you can use nice frameworks such as JQuery for that AJAX mojo.

Unfortunately the documentation wasn’t exactly up to date so I had some problems getting things up and running on my Android Developer Phone. If this is the same on the other platforms, you’re in for a couple of hours of tweaking settings and installing SDKs and googling around for fixes if you want your app running on more than one platform.

To summarize, PhoneGap is:

  • Cross platform, works on many devices – but will require setup for each.
  • Web developer friendly. People familiar with HTML and JavaScript will feel right at home.
  • Capable but still limited by browser. With the upcoming HTML5 PhoneGap will become really interesting, though!

Next in line is MoSync. (First a disclaimer: I have worked for the company behind MoSync.) The platform recently became open source and received an investment from none other than the MySQL founders, Michael “Monty” Widenius and David Axmark. Like MySQL, MoSync is based in Stockholm.

You don’t need to install any other SDK than the MoSync IDE to get started. Programming is done in C++ which means you will feel at most at home if you’re coming from the embedded or gaming world. In fact, MoSync can run legacy games like Castle Wolfenstein just fine:

(That’s me speaking in the background, by the way.)

So far, MoSync is Windows only (although the IDE is based on Eclipse) so Mac- and Linux-users are out of luck. Supported platforms include Symbian S60, Java ME, Moblin and Windows Mobile. Android, iPhone and Maemo are “coming soon”.

MoSync is cross platform but obviously you won’t get more features than the underlying platform supports. Best support you’ll get for basic graphics, sound, simple Bluetooth access and networking. Without a doubt the best feature of all is the promise of one codebase, multiple platforms, but your mileage may vary.

MoSync is:

  • Cross platform, works on many devices – Android and iPhone “coming soon”.
  • C++ based, suitable for porting old embedded apps to native but a little higher barrier to cross for the beginner (but C++ isn’t that difficult).
  • Still a bit untested, MoSync needs a few more success stories that proves their claims.
  • One codebase, one tool!

All in all, three completely different approaches to mobile development. Which one suits you? Well, that’s for you to decide. They all have their strengths and drawbacks and I think it will be quite obvious for you which one fits your bill.

Now, get out there and create great stuff for mobile!

Updated: MoSync just announced Android support.

Updated 2: David Wood wrote an overview of some other cross platform tools.