Apache Cordova is a platform for building native mobile applications using HTML, CSS and JavaScript
Prerequisite to download and install:
- Java7: https://java.com/it/download/manual_java7.jsp << install dir C:\Program Files\Java\jdk1.7.0_25 >>
- Nodejs: http://nodejs.org/download << install dir: C:\dev\tools\nodejs >>
- Ant: http://apache.panu.it//ant/binaries/apache-ant-1.9.4-bin.zip << install dir C:\dev\tools\ant >>
- Android Studio: http://developer.android.com/sdk/index.html << install dir: C:\dev\tools\Android >>
- Git client: http://git-scm.com/download/win << install dir: C:\dev\tools\git >>
After installing all make sure you add the new ANDROID_HOME and the update the PATH variable like these:
set ANDROID_HOME=C:\\dev\\tools\\Android\sdk
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\\sdk\\build-tools\\21.1.2;C:\\dev\\tools\\ant\\apache-ant-1.9.4\\bin;C:\\Users\\Administrator\\AppData\\Roaming\\npm;
1- Install Apache Cordova
C:\>npm install -g cordova
2- Create an HelloWorld app project:C:\>cordova create hello com.example.hello HelloWorld
3- Install Apache Cordova Go in the hello directory and add the android platform for example:C:>cd hello
C:\>cordova platform add android
If you get error like this:
Error: Please install Android target "android-19".
Hint: Run "android" from your command-line to open the SDK manager.
run the SDK Manager.exe from your ANDROID_HOME folder and make sure you install the SDK Platform for Android 4.4.2 (API 19). Once that is done you just rerun the cordova command above.
4- Build for Android
C:>cordova build android
5- Now before to run in the emulator to increase its speed ensure you have installed the x86 Intel Hardware Accelerated Execution Manager. To check browse the ANDROID_HOME files and open the SDK Manager to check if you have installed the extras package as in the picture below:
And then and run it form this directory:
ANDROID_HOME\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.exe
More details here: https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
Note: If during installation you get this error message below you will also need "Virtualization Technology" to be enabled on your BIOS. For example in my Lenovo Thinkpad W530 VT-settings are located located under "Security | Virtualization", not under "CPU" settings. So google it for your computer.
After enabling BIOS acceleration, finally rerun again the program intelhaxm.exe. Instead if you get the error "VT not supported" during the installation disable Hyper-V on windows features. You can execute this command
6-Finally run the test android application
This emulator size worked well on my screen :
Then finally you are ready with Cordova environment with an android emulator!
I suggest you at this point to learn more on developing Cordova with this very good tutorial:
https://ccoenraets.github.io/cordova-tutorial/index.html
Enjoy!
For official Apache Cordova documentation refer to:
http://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html#The%20Command-Line%20Interface
add android
And then and run it form this directory:
ANDROID_HOME\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.exe
More details here: https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
Note: If during installation you get this error message below you will also need "Virtualization Technology" to be enabled on your BIOS. For example in my Lenovo Thinkpad W530 VT-settings are located located under "Security | Virtualization", not under "CPU" settings. So google it for your computer.
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V. 6-Finally run the test android application
c:>cordova emulate android
The emulator will start and show the splashscreen of the default app just created. If size of the emulator does not fit correctly, close the emulator open the AVD Manager.exe and edit it:This emulator size worked well on my screen :
Then finally you are ready with Cordova environment with an android emulator!
I suggest you at this point to learn more on developing Cordova with this very good tutorial:
https://ccoenraets.github.io/cordova-tutorial/index.html
Enjoy!
For official Apache Cordova documentation refer to:
http://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html#The%20Command-Line%20Interface
add android




