Building WML Gadgets: A Calendar
This series of articles describes how to provide Web content to mobile devices through WML (Wireless Markup Language). This article covers creating small programs that extend the functionality of mobile devices, building on the previous two articles and examples:
Note: These articles cover WML and WMLScript version 1.1, which are supported by the majority of mobile devices in use today. The articles assume a working knowledge of HTML and general Web technologies, and further assume that you have read the previous article(s) in this series.
As mentioned in the last few articles, it is possible to add value to a mobile device by creating a small but ultimately useful application. In designing such an application, remember that the user will need to be online to use it, so the application's utility needs to be weighed against the potential cost of use.
Note: Most mobile service plans offer a base amount of online time dedicated to "Web" use. So the user generally isn't paying more for the occasional gadget use.
To round out our small suite of useful gadgets, let's add a simple calendar application. This application displays a monthly calendar and enables the user to move forward and backward through the months.
A Little Help from CGI
We could accomplish this gadget using only WML and WMLS. However, it would require writing some pretty extensive code to do date mathematics in order to correctly display any month within any year. Instead, we will utilize a CGI program written in Perl.
Why Perl? We could accomplish the same results with almost any Web programming language that supports date libraries (such as PHP), but Perl offers a few advantages:
- Perl is highly extensible.
A variety of modules are available to extend Perl and give us the functionality we need.
- Perl is platform-independent.
Perl is available for most platforms and is easily implemented on each.
- Perl hasn't been used in this series of articles.
If you would rather use another technology, such as PHP, simply apply the concepts outlined here to your preferred technology, using previous WML and PHP (or your preferred technology) articles for help where necessary.