Phonegap Cordova Installation on Windows
Requirements
- Eclipse + ADT Plugin
- Android SDK Tool
- Android Platform Tools
- Latest PhoneGap zip folder. Extract its contents.
Supported Android Devices
Android 2.2
Android 2.3
Android 4.x
Phonegap Cordova Installation
Set PATH environment variable for android
From desktop, right click My Computer and click Properties.
Click Advance System Settings link in the left column.
In the system properties window click the environment variables button.
Select the PATH variable from the System variables section.
Select the Edit button.
You need to add the path to your Android SDK platform-tools and tools directory. For Example:
D:\adt-bundle-windows-x86_64-20130219\sdk\platform-tools;D:\adt-bundle-windows-x86_64-20130219\sdk\tools
Save your Edit. Close the Environment Variable dialog.
- Additionally, you may need to include %JAVA_HOME%\bin to your PATH as well. To check to see if this is required run a command prompt and type java. If the program could not be found add %JAVA_HOME%\bin to the PATH. You may need to specify the full path instead of using %JAVA_HOME% environment variable.
- Finally, you may need to include %ANT_HOME%\bin to your PATH as well. To check to see if this is required run a command prompt and type ant. If program cannot be found then add %ANT_HOME%\bin to the PATH. You may need to specify the full path instead of using the %ANT_HOME% environment variable.
Set-up New Project
Open Command Prompt, navigate to bin directory within the android sub-folder of the Cordova distribution.
Type in: ./create
Then press Enter.Launch Eclipse. In File Menu Item and select to Import…</p>
Import Select “Existing Android Code into Workspace” and click ‘Next >’.
Browse the project created through command prompt. And click ‘Finish’.
Deploy to Emulator
From within Eclipse, press this toolbar icon.
Once open, the Android SDK Manager displays various runtime libraries
Install the APIs as per requirement from here.
From within Eclipse, press this toolbar icon.
Choose and device definition from the list which comes. (There is only one item in the current list.)
Press New… in the above window to create new Android Virtual Device(AVD) and use it to run your project.
To open the emulator as a separate application, Select the AVD and press Start. It launches much as it would on device, with additional controls available for hardware buttons:
Deploy to Device:
Make sure USB debugging is enabled on your device and plug it into your system.
Right Click the Project and go to Run As > Android Application.
Read more ...