Archive for January, 2008

Device detection with DetectRight

Recently, I read about DetectRight over at Jason Delport’s Mobile Observations. DetectRight is a web service for device detection; their API allows you to supply HTTP headers (or a user agent string), and query which device your mobile visitor is using.

Device detection is something we tried to tackle early on. Our first approach was to use the open source effort WURFL. Our use of WURFL didn’t last long when we noticed data for a few popular handsets was either incomplete or just wrong. (Note: this was almost a year ago, so things may have improved.)

In the end, we chose to prompt the user to select their device from a list when downloading. It’s an extra step, but it still allows us to deliver applications optimized for whichever handset you use.

Our evaluation of DetectRight is underway, and I thought I’d share our experiences.

DetectRight offers both php and SOAP APIs. Since Gleemy is written with Java on the server side, we started with the SOAP API.

To consume a web service with Java, you start by generating a client stub from the WSDL file describing the web service.

The Java API for Web Services sounded like a good place to start, but alas no luck. (What does “[ERROR] undefined simple or complex type 'SOAP-ENC:Array'” mean?)

WSDL2Java (part of the Apache Web Services project) turned out to be a lot friendlier. Running:

java -cp axis.jar;commons-discovery.jar;commons-logging.jar;jaxrpc.jar;saaj.jar;wsdl4j.jar org.apache.axis.wsdl.WSDL2Java http://www.mpwservices.net/MPWServices/soap.php?wsdl

produces a Java callable interface to the DetectRight web service, in the form of 5 java files. Awesome. Here are a few good methods from the stub:

public Hashtable getProfile(

String licence,

String manufacturer,

String model,

String schemaName

)

public Hashtable getProfileFromUA(

String licence,

String HTTPUserAgent,

String HTTPAccept

)

public Hashtable getProfileFromHeaders(

String licence,

Hashtable serverVars

)

This enables you to do things like:

profile = getProfile(myLicenseKey, userAgentString, null);

where profile is a hash table containing all known properties of the client device. Each call is marshaled across the Internet to the DetectRight servers.

You can print the profile like this:

private static void dumpHashtable(Hashtable h)
{
String[] keys = h.getKeys();
String[] values = h.getValues();
int i;


System.out.println(keys.length + " keys, " + values.length + " values");
for (i = 0; i < keys.length; i++)
{
System.out.println(keys[i] + ": " + values[i]);
}
}

I tested with popular user agents we’ve seen, and every time the API worked as expected.

We’re still playing with it. As part of any evaluation, you need to consider things like cost (DetectRight is a commercial service), license terms, level of service and so on.

First experience with QR codes

Gleemy downloads QR codeI had my first experience with QR codes on the weekend. QR codes are really cool - they make using your phone a whole lot easier. Point your phone at a little square like this one and you can easily make a call, visit a web site, download music and so on, depending on what’s encoded in the picture. The one to the right will take you to the Gleemy mobile downloads page.

I recommend you install a QR reader (unless your phone ships with one.)

This Nokia site lists a few reader applications - I tried to install each one though I was only able to test Kaywa reader and I-nigma reader with the handsets I have. Your mileage may vary depending on your handset.

I tried Kaywa reader and I-nigma reader on both S40 and S60 handsets. They work much the same, they only differ in that Kaywa reader shows an interstitial page with “Selected KAYWA mobile content” before taking you to your destination.

A significant difference between the S40 and S60 versions of both readers is that you only need to wave the phone in front of the code on an S60 (Symbian) device. On an S40 (Java) device you need to more carefully frame the code with the phone’s camera, then press a button and wait a few seconds for the picture to be decoded.

Why the difference?

Both Java applications are unsigned; therefore they have restricted access to features like acquiring pictures with the camera. The phone asks your permission by showing a prompt before passing the picture to the application.

Java applications execute much more slowly than native Symbian applications. With Java, I can imagine the camera API returns a JPG, the Java application retrieves the pixel data (the JPG data is decoded) then the application iterates multiple times over the array of pixels to decode the QR code. Array accesses are slow in Java as the virtual machine checks each access for out of bounds conditions.

Don’t let that deter you, if you haven’t already go ahead and install a reader.

Mobile Monday Sydney

Almost a year ago, a mobile developer friend asked if I was interested in going along to Mobile Monday Sydney. I was definitely interested, but it seemed to make more sense attending after actually shipping our mobile product.

Well, we did that, so last night I went along.

Gary Chan from Forum Nokia spoke first about Web 2.0 on the mobile, Web Run Time, Forum Nokia and Mosh.

My chief take away from his talk is on the direction Mosh is taking. Mosh will move towards connecting the long tail of developers with the markeplace by ad supporting developers’ content and sharing the ad revenue.

This probably doesn’t mean much to most people, but if you independently write mobile apps, with Mosh you at least have a chance of making some money. (Either that, or you can develop for Android to be in for a share of the cool $10M.)

The following panel discussion was about Mobile 2.0, and has been blogged here and here.

N800 Internet Tablet: Don’t worry, be crappy no more

I traveled to Melbourne over the Christmas break and had a fantastic time catching up with family and friends.

While taking time out, Eugene and I still wanted to keep an eye on the Gleemy server logs, and so before leaving for Melbourne I configured my Nokia N800 Internet tablet for the task.

Firstly, I upgraded my data plan with Three from $5 for 10Mb/Month to $12 for 100MB/Month. Pairing the N800 with my 6288 for an Internet connection Just Works.

I set up secure SMTP for sending mail and installed ssh for access to a shell on the Gleemy server.

Finally, I wrote a few shell scripts to notify us of important events on the server, which were delivered promptly to my N800, paired with the 6288 and usually kept in my pocket.

This set up worked great for monitoring the server and writing short emails. A bluetooth keyboard (or even, gasp, a laptop computer) would still be needed for non-trivial development, or writing long emails.

After arriving home, my use for the N800 wasn’t critical and so I promptly upgraded to OS2008. Man, is this thing slick. The UI is so much faster and snappier, the browser rocks, the on-screen keyboard feels so much better and affords fewer mistakes.

OS2007 was great last year, but was made crappy by OS2008 - a great example of Guy Kawasaki’s “Don’t worry be crappy” principle.

An innovator doesn’t worry about shipping an innovative product with elements of crappiness if it’s truly innovative. The first permutation of a innovation is seldom perfect–Macintosh, for example, didn’t have software (thanks to me), a hard disk (it wouldn’t matter with no software anyway), slots, and color. If a company waits–for example, the engineers convince management to add more features–until everything is perfect, it will never ship, and the market will pass it by.

Photo walk in Melbourne Oh, and here’s a Gleemy Slide Show I made of a photo walk I took in Melbourne. Most of these were taken with a Nokia 6120 Classic. You can download it straight to your mobile by visiting http://gleemy.com/zqy8 with your phone - or - Preview on your PC with mpowerplayer. Or do both :) 23/2/08 UPDATE: Check out the new Slide Show Profile page to preview it on your PC: http://gleemy.com/#profile/0gva

Up and running

Gleemy has been up and running for over a week now. It’s been awesome seeing early users pick it up and try it out.

The experience for most users has been glitch free so far. The biggest issue we found (and fixed!) was that some email wasn’t being sent properly. Mainly invite emails were affected by this one.

We’re now making room for more accounts - if you want to play with a new way of making Slide Shows for your mobile, request an invite at gleemy.com