This is going to show you how to get a coldfusion app on your cellphone or pda’s micro-browser in literally minutes! It’s so easy… you’ll be surprised… I promise. Don’t forget to tell me in the comments how unbelievably easy that I have made this for you, okay?
Here we go:
First, the most important part is your first line… the CFCONTENT tag. Just copy and paste this… It will rarely change, but keep a check on the W3C website of the wapforum.org website. If you don’t have the appropriate CFCONTENT and DOCTYPE tags at the top of your cfm file, you’ll not see the page in the mobile browser. If you are using firefox, search for the micro-browser or wml browser extension, so that you can just test in firefox.
Very, VERY important to pay attention to adding your xml tag DIRECTLY after your CFCONTENT… same line and everything. Just like this:
<cfcontent TYPE=”text/vnd.wap.wml”><?xml version=”1.0″ encoding=”iso-8859-1″?><!DOCTYPE wml PUBLIC “-//WAPFORUM//DTD WML 1.1//EN”
“http://www.wapforum.org/DTD/wml_1.1.xml”>
Next, just add your typical CFML query, as normal. Let’s get all of the Jones’ family phone numbers to display.
<cfquery name=”qContacts” datasource=”#ds#”>
select firstname, lastname, phonenumber
from contacts
where family=”Jones”
</cfquery>
Easy enough so far, right? Now, let’s make this baby output some mobile data!
<wml>
<card title=”Contacts”>
<cfoutput query=”qContacts”>
#firstname# #lastname#: #phonenumber#
</cfoutput> </card><wml>
And that, my friends, is a crazy easy ColdFusion web application! Don’t believe me? Go try it yourself. It’s easy stuff… so, go now, and write a dozen little mobile apps for your coldfusion websites.
What I like to do is have “mobile” subdomains. So, for example I have “www.sound-hole.com” for the bands website. Now, for their mobile website… I just have it setup to show their fans their tour dates for that week. So if they (or you!) go to “http://mobile.sound-hole.com” on any mobile device, like your phone or pda, you can see any show that the band is playing in the next week. Pretty schnazzy, huh?
Enjoy!
