phongap beginning guide step by step

phongap beginning guide step by step

The “Getting Started with Android phonegap” guide from PhoneGap is good, but does not show all pitfalls you may encounter like i did.

You will learn from this Post:

  • how to Install Apache Ant
  • how to Install Java JDK
  • how to Install Eclispe Classic
  • Set all needed environment variables (JAVA:HOME, ANT_HOME and so on)
  • how to Install the Android ADT Plugin for Eclipse
  • How to Install the Android SDK
  • How to Intall PhoneGap Apache Cordova 2.2.0
  • Avoid the pitfalls while creating Android Projects

Requirements before starting

I will show it step by step don’t worr

  • Apache ant
  • Java JDK
  • Android SDK
  • Eclipse Classic
  • All Path variables has been set (JAVA_HOME, ANT_HOME, ANDROID_HOME)

Downloading Apache Ant and setting the ANT_HOME variable

got to Apache Ant – Binary Distribution and download the version you want.(any which is latest)

how to install phonegap in android, phonegap development in india, phonegap developers, phonegap development in, Java EE, WordPress, drupal, Joomla, development, Website development, Web development, Web designing, Blog Content Marketing, Magento development, ASP.NET Development, OpenCart Web Development, E-commerce Web Development, Iphone apps development, Mobile application development ,IT company in, firms in, agency in, developers in, top software development company in,  India, London, Lancaster, Leicester, Liverpool, Manchester, Oxford, Scotland, Birmingham, Leeds, Paris, Bangkok, Beijing, Cairo, Kolkata, Delhi, Los Angeles, Moscow, New York, Mumbai, Tokyo, Shanghai, UK, USA, Canada, thailand, newzealand, Australia, paris, melborne, spain, china, russia, pune, surat, banglore,  Istanbul,  Moscow, São Paulo, Beijing, Guangzhou, Shenzhen, Seoul, Jakarta, Kinshasa, Tianjin, Dhaka, Cairo, Limra, Mexico City, Tehran, Hong Kong, Baghdad, Wuhan, Hyderabad, Lahore, Santiago, Riyadh, Shantou, Luanda, Saint Petersburg, Abidjan, Chengdu, Yangon, Chennai, Alexandria, Chongqing, Kolkata, Johannesburg, Nanjing, Dar es Salaam, Ankara, Harbin, Giza, Suzhou, Zhengzhou, Sydney, New Taipei City, Cape Town, Shenyang, Melbourne, Yokohama, busan, Hangzhou, Xiamen, Berlin, Jeddah, Durban, Kabul, Hefei¸ Pyongyang, Madrid, Ekurhuleni, Nairobi, Addis Ababa, Changsha, jaipur, Wenzhou, Indonesia, Brazil, Nigeria, Bangladesh, Russia, Mexico, Philippines, Vietnam, Ethiopia, Egypt, Germany, Iran, Turkey, Thailand¸Burma, Spain, Italy, South Africa, South Korea, Colombia, Spain, Ukraine, Tanzania, Kenya, Argentina, Algeria, Poland, Sudan, Uganda, Canada, Iraq, Morocco, Peru, Uzbekistan, Malaysia, Saudi Arabia, Venezuela, Nepal, Afghanistan, Yemen, North Korea, Ghana, Mozambique, Australia, Ivory Coast, Syria, Madagascar, Angola, Cameroon, Sri Lanka, Romania, Burkina Faso, Kazakhstan, Niger, Netherlands, Malawi, Chile, Guatemala¸Ecuador, Mali, Cambodia, Zambia, Zimbabwe, Senegal, Chad, South Sudan, Belgium, Cuba, Guinea, Tunisia, Greece, Rwanda, Czech Republic, Portugal, Haiti, Benin, Bolivia, Hungary, Sweden, Azerbaijan, Belarus, Dominican Republic, Burundi, Honduras, Austria, United Arab Emirates, Tajikistan, Israel, Switzerland, Papua New Guinea, Bulgaria, Hong Kong, Paraguay

create a folder called ANT in the directory “C:\Program Files\” and unzip file in it. By me it looks : C:\Program Files\ANT\apache-ant-1.8.4

Copy that above path (C:\Program Files\ANT\apache-ant-1.8.4) and set the ANT_HOME path. to do that go to: Start > Search > Advanced System Settings > Environment variable > by System variable >click the button new > and then type in: ANT_HOME and C:\Program Files\ANT\apache-ant-1.8.4 into the fields. After that you must add this new variable to you PATH. Look for Path in the box System variable and press edit. Then add you new ANT_HOME path like this to the and of you Path: %ANT_HOME%\bin;

 

android game development, android game developer, android game developers, android games development, android games, how to make android games, game development android, how to develop android games, android 2d game development, developing games for android, android 3d game development, develop android games, developing android games, develop games for android, android games developer, game development for android, how to develop games for android, android game development, android game developer, android game developers, android games development, android games, how to make android games, game development android, how to develop android games, android 2d game development, developing games for android, android 3d game development, develop android games, developing android games, develop games for android, android games developer, game development for android, how to develop games for android

mobile apps maker, android developers, android application development company, android game development, android game developer, android game developers, android games development, android games, android 2d game development, developing games for android, android 3d game development, developing android games, develop games for android, android games developer, game development for android, android development company, agency, firms in India, UK, USA, Canada, thailand, newzealand, Australia, paris, new york, melborne, spain, china, russiawebsite development, web development, web designing company india, mobile apps development, iPhone application development, android apps development india, open source customization UK, USA, Canada, Newzealand, franse, wordpress, drupal, joomla development firms, agancy, hire developers, outsource IT development company india.phonegap development company in, Java EE, WordPress, drupal, Joomla, development, Website development, Web development, Web designing, Blog Content Marketing, Magento development, ASP.NET Development, OpenCart Web Development, E-commerce Web Development, Iphone apps development, Mobile application development ,IT company in, firms in, agency in, developers in, top software development company in,  India, London, Lancaster, Leicester, Liverpool, Manchester, Oxford, Scotland, Birmingham, Leeds, Paris, Bangkok, Beijing, Cairo, Kolkata, Delhi, Los Angeles, Moscow, New York, Mumbai, Tokyo, Shanghai, UK, USA, Canada, thailand, newzealand, Australia, paris, melborne, spain, china, russia, pune, surat, banglore,  Istanbul,  Moscow, São Paulo, Beijing, Guangzhou, Shenzhen, Seoul, Jakarta, Kinshasa, Tianjin, Dhaka, Cairo, Limra, Mexico City, Tehran, Hong Kong, Baghdad, Wuhan, Hyderabad, Lahore, Santiago, Riyadh, Shantou, Luanda, Saint Petersburg, Abidjan, Chengdu, Yangon, Chennai, Alexandria, Chongqing, Kolkata, Johannesburg, Nanjing, Dar es Salaam, Ankara, Harbin, Giza, Suzhou, Zhengzhou, Sydney, New Taipei City, Cape Town, Shenyang, Melbourne, Yokohama, busan, Hangzhou, Xiamen, Berlin, Jeddah, Durban, Kabul, Hefei¸ Pyongyang, Madrid, Ekurhuleni, Nairobi, Addis Ababa, Changsha, jaipur, Wenzhou, Indonesia, Brazil, Nigeria, Bangladesh, Russia, Mexico, Philippines, Vietnam, Ethiopia, Egypt, Germany, Iran, Turkey, Thailand¸Burma, Spain, Italy, South Africa, South Korea, Colombia, Spain, Ukraine, Tanzania, Kenya, Argentina, Algeria, Poland, Sudan, Uganda, Canada, Iraq, Morocco, Peru, Uzbekistan, Malaysia, Saudi Arabia, Venezuela, Nepal, Afghanistan, Yemen, North Korea, Ghana, Mozambique, Australia, Ivory Coast, Syria, Madagascar, Angola, Cameroon, Sri Lanka, Romania, Burkina Faso, Kazakhstan, Niger, Netherlands, Malawi, Chile, Guatemala¸Ecuador, Mali, Cambodia, Zambia, Zimbabwe, Senegal, Chad, South Sudan, Belgium, Cuba, Guinea, Tunisia, Greece, Rwanda, Czech Republic, Portugal, Haiti, Benin, Bolivia, Hungary, Sweden, Azerbaijan, Belarus, Dominican Republic, Burundi, Honduras, Austria, United Arab Emirates, Tajikistan, Israel, Switzerland, Papua New Guinea, Bulgaria, Hong Kong, Paraguayphonegap development, phonegap developer, phonegap expert developers

Download JAVA JDK

First find out which kind of processor your PC supports and then take the version with fits to your PC. 32Bit or 64Bit To find it out which one you have go to Start > System Setting > System and Maintenance > System then you will see the information of your PC like 32bit or 64bit system.

Now we will do the same process with the JAVA JDK as we did with ANT.Go to Java SE Downloads and download the version you want.
phonegap development, phonegap developers, phonegap experts
java02
Now just run the installer by doble clicking it and install it in the default directory it has been proposed by the wizard. Something like this by me: C:\Program Files\Java\jdk1.7.0_07 Now do the same steps as we did by Ant and set the JAVA_HOME variable and add it to your Path.
and same for ANDROID_HOME below:
  • let’s assume you have installed your Android SDK to the c:\sdk\android directory
  • you have installed you Apache ant to the c:\tools\apache-ant directory

Then you must create two system variables:

  1. ANDROID_HOME with the c:\sdk\android value
  2. ANT_HOME with the c:\tools\apache-ant value

Finally, you must modify the PATH variable and add those two to the end of the PATH‘ value:

;%PATH%\tools;%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

Downloading and install Android SDK

Go to: Android SDK and download. Double click it and install it in the proposed default folder. by me it looks like this: C:\Program Files\Android\android-sdk.

android01

Download Eclipse Classic and installing the Android plugin

Let’s download and install Eclipse now. That’s will be our development tool. Go to Eclipse Downloads and download the classic version version you want. As you know now which platform you have 32bit or 64bit you can take the one which fits to your PC. In my case it is the 32bit version.

eclipse02Now let’s install the Android Plugin. In the directory of your Eclipse double click eclipse.exe to start it.
eclipse03
Close the welcome tab and then select Help – Install new software… and install the ADT Plugin as described bellow. See the screen sequences bellow:
plugin01plugin02After installing Android ADT Eclipse may ask you to restart it. Say yes. At this point the Android SDK Manager may start and shows a list from uninstalled packages to you, just select them all and install it. this may take several minutes. Alternatively you may go to Installing Eclipse ADT Plugin and take the steps directly from there.

Download and install PhoneGap Apache Cordova

Go to: Apache Cordova and download the version you want.

cordova01First pitfall: Do not unzip this file in the default folder C:\Program Files because of the spaces in it. Instead of that, create a new directory called: C:\development and unzip it in there. Then in this directory unzip the file incubator-cordova-android.
cordova02

Pitfalls while creating projects

1: Do not create your projects in the same directory as the eclipse workspace. This will result in a failure while trying to open your project later with Eclipse.

2: Do not create a folder to hold your projects. If you do that, that following Step will fail with the statement: This project exits already! in the window command prompt console. This must be done with the create command we will see bellow.

final: That’s the interresting part. go into unziped directory called C:\development\cordova-2.1.0\incubator-cordova-android select the bin folder, press and hold the key shift and press right mouse click. From context menu select open command prompt from here. By me it looks like this:

create new project in phonegapprompt01Then run the create command with your coordinates to create a new project.C:\development\cordova-2.1.0\incubator-cordova-android\bin>create C:\Users\jemish\phonegap\android_projects com.yourcompany.appname projectname
The folder android_projects does not exits already. It will be created with the create command above. If you create it manually before running the create command, you’ll get an error saying: This project already exists! So do not create it manually.A new project will be created. Important is to check if the project was really created. To be sure go into directory C:\User\Jemish\phonegap\android_projects and if there is a something like this bellow, then you are fine.
project02

Loading created project into Eclipse

Now we are almost done! Start Eclipse again and press Ctrl + N and select Android Project from Existing Code > root to your created folder android_projects > select the new created project and press finish. Now we are ready to start.

project03
Your Phonegap Project is imported. and now you can test that project by emulator or android phone.