Wednesday, 26 November 2014

ColdFusion 11: My First Mobile Application (Hello World)

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 -


10 comments:

  1. This is a great post ! it was very informative. I look forward in reading more of your work. Also, I made sure to bookmark your website so I can come back later. I enjoyed every moment of reading it.kim kardashian sex tape
    porn sex video hd
    mia khalifa sex video
    sunny leone sexy movie

    ReplyDelete
  2. Very significant Information for us, I have think the representation of this Information is actually superb one. This is my first visit to your site.
    Best Mobile App Development

    ReplyDelete
  3. Brilliant post! I am planning to create a custom app with the help of a simple booking mobile app builder so that I can use it to boost bookings for my hair salon business.

    ReplyDelete
  4. Clear cut explanation. Am pretty much impressed with your explanation. Looking for the best phone gap app development services in Hyderabad, India? Contact Cyanous software solutions now.

    Best network penetration testing services in Hyderabad
    Best software & web development company in Hyderabad

    ReplyDelete
  5. Flutter is a new cross-platform mobile appSDK for building high-quality native apps on android, iOS, and beyond. Getting started with Flutter is easy, and you can build beautiful apps in minutes with hot-reload (the Flutter equivalent of Live Reload) and integrated tooling. Flutter gives you all the benefits of native mobile development, in an approachable framework, with a productive, modern workflow.

    ReplyDelete
  6. This article is worth sharing, so inspiring and full of information. Thankyou for sharing this!!
    on demand home service app development

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete