Sunday, July 27, 2014

creating phonegap/cordova application for android

Step by step : Platform –android ,OS-Window;
As my experience ,It is more easy to created Cordova /Phonegap application through Command-Line Interface .

Step 1: Download and install Node.js. Following installation, you should be able to invoke node or npm on your command line.( site:  http://nodejs.org/ )

Step 2: Download and install a git client,* ( site : http://git-scm.com/ ) . you need git client in feature for adding plugin.

Step 3:  go to your Nodejs installed directory (mostly in C:\Program Files\nodejs  at my system)in Command Prompt . C:\ Program Files\nodejs  >npm install -g cordova

Step 4: please mention –g this will help to install cordova globally.it take some time to download cordova Libraries .

Step 5: After that create your project : copy and paste
cordova create hello com.example.hello HelloWorld
cordova create: command to create cordova project .
hello :directory of this name will be created at your current location in cmd .so change your  directory path to specific place where you want to create your project .
com.example.hello :package name of your project .you can change this.
HelloWorld :Name of your project.

Step 6 : wait for completing process.
Step 7: now you can see hello folder at  the destination .
Step 8:now enter to project folder as   D:/joshi>cd hello

Step 9 :now add platform as   D:/joshi/hello> cordova platform add android
To check add platform use > cordova platforms ls
To remove plateform use > cordova platform rm android

Step 10 : now to  build app > cordova build android
Step 11: compile and prepare :
                  >cordova prepare android
> cordova compile android
Now your project ready with hello world application. And you can add this project to eclipse . (use this : http://android.programmerguru.com/how-to-import-android-project-in-eclipse/ )

Step 12 : you can move this build project from one pc to other (Nodejs must be installed)
Step 13: when you import cordova project .it ask you to import to project .please select both project .Use your eclipse adt to run application.

If you getting error or need any help related to cordova/phonegap. Please mail me at : jk2386@gmail.com  or leave your question in comments.

No comments:

Post a Comment