The Future of Mobile Websites
By Jonathan Goodyear
One of my favorite movies of all time, "Back to the Future," is about a boy who travels back in time and accidentally interferes with the first meeting of his parents, thereby jeopardizing his own existence. He spends the rest of the movie attempting to get his parents together to ensure that he is born in the future. (See http://www.imdb.com/title/tt0088763/.)
It's fun to contemplate the effect that might result by changing a single event in the past. Recently, I've been developing a lot of mobile-enabled websites, and I was considering using the ASP.NET Mobile Controls. My research turned up very few examples on how to best implement them, and it turns out that few developers have used them. Not much has been done to keep them current with the current mobile browsers.
So why didn't the ASP.NET Mobile Controls catch on? And what are you supposed to use if you have to build a mobile website today? The answer to the first question is timing and discontinuity. When the Mobile Controls were released, Internet-enabled mobile phones were not nearly as prevalent as they are today, and Internet service plans were expensive. To make matters worse, there were dozens of different mobile browsers and browser versions with varying levels of capabilities which spoke several different web dialects (e.g., WML/WAP, HTML, cHTML). This made it very difficult to design mobile websites that could function on a reasonable number of devices, even with the help of the Mobile Controls and Browser Definition Files that were constantly out of date (http://msdn.microsoft.com/en-us/library/ms228122.aspx). The only mobile web development that made sense was development for internal purposes where you could control the number of clients that you were going to support (namely, BlackBerry and Windows Mobile).
In the very near future, when you build a mobile website you'll mostly need to care about screen real estate and bandwidth (though the emergence of 3G speeds on almost every wireless carrier has made that less of a concern than it has been). We're still some time away from a "one browser to rule them all" world, though. Devices still have varying screen sizes, and some devices have special features that you may want to tap into.
If you're beginning a mobile website in the near future, I recommend using the ASP.NET Model View Controller (MVC) Framework (http://www.asp.net/mvc/). With ASP.NET MVC you can leverage your own mobile view engine to render different Views based on the browser that made the web request, all while using the same business logic at the Controller level. You could create a baseline version of your mobile web application and emit special up-level versions of your Views if you detect an iPhone, Windows Mobile, or Android phone browsing the site (http://www.hanselman.com/blog/MixMobileWebSitesWithASPNETMVCAndTheMobileBrowserDefinitionFile.aspx ). To help you determine the capabilities that the device browsing your site supports, Microsoft has compiled a Mobile Device Browser File and released it on CodePlex (http://mdbf.codeplex.com/).
ASP.NET MVC doesn't carry the extra bandwidth overhead that forms-based ASP.NET needs for things such as page state. You can emit clean, standards-compliant output that precisely supports the browsers that you intend to target. Don't assume that the device browsing your site has a high-speed Internet connection. There's still something to be said for bandwidth optimization.
Everything I've listed above is available right now. If you have a little time before your next mobile project, you may want to consider Silverlight (http://silverlight.net/learn/mobile.aspx). Although a mobile version of Silverlight is not currently available, I'd hope for a public beta or release in the 2009 timeframe.
I think that the ASP.NET Mobile Controls were before their time; even a trip back to the past wouldn't be enough to help them overcome the extreme technical challenges of that era's mobile browsing landscape. As mobile devices begin to resemble miniature full-fledged computers, the ROI for building mobile-enabled websites is increasing dramatically. If you've been holding off on building the next great mobile website, now may be the time to jump into the game.
Jonathan Goodyear ([email protected]) is president of APSOFT, an Internet consulting firm in Orlando, FL. He is Microsoft Regional Director for Florida, an ASP.NET MVP, a Microsoft Certified Solution Developer, and a contributing editor for asp.netPRO.