A simple example

Building mobile applications using the ColdFusion Mobile Platform is easy. Your code will be as simple as:

<cfclient>
<cfset myvar = "Hello World">
<cfoutput>#myvar#</cfoutput>
</cfclient>


Note the new ColdFusion tag, <cfclient> that will be used for mobile development (see The new <cfclient> tag). The ColdFusion content available in the <cfclient> block gets translated into corresponding HTML/JavaScript content.

A more complex example

Let us launch the device camera:

<cfclient>
<cfscript>

function launchCamera()
{
// Capture the image from the device comera
var opt = cfclient.camera.getOptions();
var resp = cfclient.camera.getPicture(opt);
var fileContent = cfclient.file.readFileURIAsBase64(resp);
// Process the image
return;
}

</cfscript>
</cfclient>


Examples

Community posts and tutorials

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy