homepage

Friday, November 18, 2011

WURFL API: Luca Passani Explains Its Benefits for Mobile Website Development


WURFL's creator Luca Passani explains how the WURFL API and resource file helps mobile website developers accommodate various device types
rating: (1)
Editor's note: Welcome to .NETRocks Conversations, excerpts of conversations from the .NET Rocks! weekly Internet audio talk show. Hosts Richard Campbell and Carl Franklin chat with a wide variety of .NET developer experts. This month's excerpt is from show 653, with Luca Passani, a software engineer focused on mobile development who created the WURFL open source mobile-device-information repository and founded WURFL-Pro. Luca explains the value of WURFL as a time-saving tool for mobile website developers.
 
Carl Franklin: We got an email from your friend Dino Esposito, also from Rome, who said you guys have got to have Luca on. He has done something amazing for mobile devices. Tell us.

Luca Passani: Yes. So WURFL is exciting news for people who are approaching mobile now and are discovering that it's not like the web because every device is different and needs to be handled sometimes singularly. But people who have been doing mobile for some time have heard of WURFL or even use WURFL because it's been around for almost 10 years now.

CF: Now what does WURFL stand for?

LP: So that stands for Wireless Universal Resource File. Now about 10 years ago, the term "wireless" was used for what you would call "mobile" today. So if WURFL was created today, it would probably be called MURFL.

CF: MURFL.

LP: Which, yes, we thought it would be even worse than WURFL. But anyway, I digress. So it's WURFL. You Windows guys probably remember those INI files, the resource files.

CF: I'm trying to forget.

LP: Yes, right. Anyway, the point here was that WURFL would be some kind of resource file on steroids where the programmers could put information about the different devices. This way, updating mobile applications to accept and perform optimally with new devices will just be a matter of configuration, not recompiling or rebuilding your application to hardware device information. That was the basic point, to externalize their device information.

CF: Yeah.

LP: So WURFL is a repository of device information. The two main functions that the WURFL API performs are looking at the HTTP headers of request from a mobile device-and, most notably, the utilization string-and then after that [looking at] the WURFL ID, which is a string of the unique ID of an XML profile that contains information about the device. So the first function will map a utilization to the WURFL ID, and the second main function will map this WURFL ID and a capability name. Capability means property in WURFL speech.

CF: Yeah.

LP: So given an HTTP request, a developer can programmatically figure out how large the screen is, how many colors you have, and whether your device is Windows [Phone] 7.0 or not, or if it's Android, or if it's an iPhone. And also more detailed functions, like can I use the data when you write a schema to a nice picture inside the page? Are you familiar with the data you write? CF: Yes. Basically what I hear you saying is that this does what ASP.NET was supposed to do for us but for all of these devices. It's a huge repository of capabilities information for every mobile device out there.

LP: Right. In fact, there have been quite a few .NET programmers hanging out on the WURFL mailing list, and they never could figure out why Microsoft didn't come up with something along the lines of WURFL. Well, actually they did.

CF: They did.

LP: I remember there was something called Mobile Controls, but the device information was so poor or at least so simple that people preferred to look elsewhere, and WURFL was, of course, there. I know of some big companies that use WURFL in a .NET environment.

CF: Yeah.

Richard Campbell: So, this sounds like the BrowserCaps file for regular desktop browsers from years ago.

CF: Yeah. I mean, probably there is a similarity in the concept there, but WURFL, of course, took it a lot further because on a day-by-day basis it was a collective requirement from the community of the developers using WURFL.

RC: Digging all the way down to like, does the particular device have GPS or things like that?

LP: Yes. Well, actually we don't track GPS per se, but one of the capabilities in the JavaScript group is about which API can be used for location, whether it's a Google gear, or the W3C one, or whatever.

CF: And is this a static repository like a file that you have to constantly update, or is it a service?

LP: Essentially this is about a static repository, which any developer can download from the WURFL website, and off they go. They're totally independent. They don't need to rely on a third-party service to be available somewhere on the Internet.


ARTICLE TOOLS

Comments

Add A Comment
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

Blog Archive



      © 2012 Penton Media, Inc.