I have
created a simple Mobile Application with help of ColdFusion 11.Here I will
focus on the steps in which we will create the mobile application instead of
creating a complex application. After understanding of basics, we can create
complex one. I am going to
explain setup we require to develop a ColdFusion mobile application and how we
can test it and finally how we can package it to create .apk file. CF
builder 3 has in built ColdFusion server and will get automatically configured
when we install it.
Step 1 -
Create a mobile project and write a Code inside CF builder 3
1. Right
click on the navigator & create a new ColdFusion mobile project. Click Next.
2. Choose
blank template. Click Next.
3. Provide
name to project and check the check box ‘Use default location’. Click Next.
4. Select
‘defaultLocal’ as server. Click Next.
5. Check
the checkbox – Create default link folder and click finish.
After
this you can see the following folder structure will be created inside
navigator area –
YYou can see
some code comments inside cfclient tag. This is a new tag
introduced in ColdFusion 11 to support mobile development..Whatever CF
code we write inside this tag, it will get converted to the HTML and
Javascript. Only few tags are supported inside CFCLIENT.
Index
file, by default create inside the folder when we create mobile application
Write the
following code inside index file.
<cfclient>
Hello World !!!
</cfclient>
If you
will run the above code as a normal coldfusion application then you will see
the output as “Hello World !!!” but if you check the source code then you
realize theat CFCLIENT is actually doing conversion of code to the HTML
and Javascript.
Step 2 – Run
the code and test on simulator
We need to
use the PhoneGap Shell Application while developing your ColdFusion Mobile
project to quickly test the application.
Download
the one from below link -
To run the
.apk file on desktop download bluestacks App player
And
run the above downloaded. apk file for shell application it will open the
phonegap shell application -
After providing
the url as shown, it will display the output –
Step 3 –
Create .apk file and run the application on the mobile
PhoneGap
is the adobe ‘s product which is used to create package and to create. apk file.
Before we
package the application, we need to configure a few parameters in ColdFusion
Builder Related to PhoneGap Build server. If you do not have an account with
PhoneGap, you need to create one now. Go to build.phonegap.com to create an
account.
Remember
that phone gap will allow to create only one private app. To create more than 1
apps you need to purchase license for some period and that is also limited. We
can create multiple public app.
There are
two different ways to create package
I. Using
coldfusion Builder 3
To create
the package by using CF builder, we have to do some configurations. If you have
adobe id then you can directely login to build.phonegap.com or if you
don’t have Id then create the new account.
Before
starting to create build go to the window à preferences à coldfusion à phonegap
Provide
the username and password.That’s it . You are now ready to create a build.
Steps to
create a build –
1. Right
click on the mobile project and click “Generate Phonegap Build”
2. After
that build processing will get started.
If you
have already create a private app in phone gap while using free trial of
Phonegap and try to build second one you will get following error message.
If no error then you can see down load
button as shown below.By which you can download .apk file.
II. By using Phonegap
Instead
of creating a build in CF builder you can create it using phonegap.Log in to
PhoneGap with the adobe Id .After that you can choose private app or public app.
In our
case we will choose public app. In this case we need git hub path of our
project. We can directly link our git hub account with Phone gap.
After
successful browsing the project phoneGap will build the project and you can
download .apk file.
If you
want to make more advanced application with ColdFusion then check the below
blog. How to create expense tracker application with coldfusion -
http://www.adobe.com/devnet/coldfusion/articles/build-your-first-mobile-app.html
Please donate if you like my work!
Donate if you like my work
Please donate if you like my work!
Donate if you like my work