How do I install Phonegap 3.3 on Windows - android

I just went to Phonegap and saw that I needed to install node.js to get started.
I did this, then followed the command line to install phonegap.
However, where is it? I don't see anything in my program files folder, I don't see Eclipse, and there's no documentation on what to do next on Phonegap's website. I don't understand why this instruction is so vague? What am I missing? And where did all those files I downloaded/installed go go?
Thanks

Phonegap 3.3 installation there is no proper info in phonegap site.
The reason of installing nodejs is, phonegap cordova are created as node modules.
Required Software’s:
Follow the steps. 1 Node Js 2 ANT 3 Android_sdk 4 JDK
open command prompt:
Follow the steps
C:\user\youruser>npm install -g phonegap
C:\user\youruser>npm install -g cordova
Set Environment variables:
Mycomputer -> Right Click -> properties -> Advance System settings -> Environment
variables
set path for 1. Java JDK 2. Android SDK 3. ANT
C:\user\youruser>cordova platform add android
C:\user\youruser>phonegap create First-app
C:\user\youruser>cd First-app
C:\user\youruser>phonegap run android
Phonegap will be installed and apk will be created in bin folder.
You will be getting
[phonegap] detecting Android SDK environment..
[phonegap] using the local environment
[phonegap] compiling Android...
[phonegap] successfully compiled Android app
[phonegap] trying to install app onto device
[phonegap] successfully installed onto device
You can able to see phonegap modules in C:\Users\yourusername\AppData\Roaming\npm.
Hope this will be very helpful. Let me know if you face any issues.

Phonegap installation steps present on the official site are somewhat vaguely presented and hasn't been properly updated.
With respect to your question, I think this post https://stackoverflow.com/a/18751002/4277415 might help you out.
Cheers.

Install phonegap without any error : http://www.markupjavascript.com/2014/07/installing-phonegap-in-windows.html

Related

Cordova Project from Github

I m cloning a cordova app sourcecode from github. How do I install cordova and add android platform to it and build it in Android Studio?
After cloning the code, I am installing cordova, but cant add platform or anything related to cordova. Is there any tutorial on how to follow the correct steps to make it run in Android Studio? I am very new to Cordova. Thanks!
First of all: follow the GitHub repo's README and look for installation instructions.
To play around with a cordova app, you most definitely need the cordova CLI. If you haven't already, install NodeJS and npm from http://nodejs.org or using your package manager of choice. Then inside a terminal run
npm install -g cordova
(If you are using Linux you probably have to run that command with sudo)
Now you navigate into the cloned github repo and run
cordova platform add android
cordova build android
It will create a directory under ./platforms/android which you can open using Android Studio. Then you can run the app with an emulator or a connected device.
If at any point you receive error messages or you think something is missing, you can run (inside the GitHub cloned repo)
cordova requirements
It will show you if the cordova CLI is missing something. You will have to fix all the errors that come up. Consult the cordova documentation under https://cordova.apache.org/docs/en/latest/guide/cli/#installing-the-cordova-cli in order to do that.
Hope this helped.
Please note I am not a programmer . I am ex Banker and entrepreneur now .I got really frustrated while setting cordova with all those errors for building android apps in windows. Though, I now understand this is the simplest cake, if you know the know-how. I love coding, so I am sharing the whole length of steps . You can figure out what step you are missing.
Step 1. Requirements :
(a)node js ( npm )-- install it
(b) Install cordova by command -->
npm install -g cordova
(c) Install Phone gap by command --> npm
install -g phonegap
(d) Ant apache ( download bin not source ) by visiting
https://ant.apache.org/bindownload.cgi . Keep this in C:/ Program files
(e) JDK version 8 . you can down load previous version by visiting
oracle.com
NOTE : Keep ( ANT ) and JDK in Same Folder i.e extracted (d) and (e) in C:/Program files
Step: 2 Setting Environment Variables
you can visit : Control Panel\System and Security\System--> environment variables You can see two types of windows : User and System
User Environment Variables:
You have to set ANT_HOME and JAVA_HOME
Add new variable :
Variable name :ANT_ HOME
Variable value : C:\Program Files\apache-ant-1.10.3
Variable name :JAVA_ HOME
Variable value :C:\Program Files\Java\jdk1.8.0_172
System Environment Variables: edit path and at the end use ; and paste ant/bin address
PATH :
Variable name :path
Variable value :....C:\composer;C:\Program Files\Git\cmd;C:\Program Files\apache-ant-1.10.3\bin
NOTE : Check ant & java configuration by windows command prompt :
ant -version and java --version . If using git then git --version.
If you error free then proceed further.
Step 3. Create a cordova project
something like this command: cordova create hello com.example.hello HelloWorld
Step 4. create platform android or ios: ensure proper config.xml
**Step 5. now check cordova requirements: This work in app folder only **
Now build your app.
Other errors you get if you miss these:
check ="ANDROID_SUPPORT_VERSION" in config xml.
Add Required Plugin - cordova plugin add -- as you need in config.xml
Cordova requirements: This work in app folder only
Cant find the Ant Version: you have not used ANT_HOME, JAVA_HOME folder name.Ensure ANT_Home and JAVA_HOME only in User folder while the path in System Variable. Never use / " or ' in writing these variables.
"IF YOU DONT REQUIRE ANT AND GIT ---> Dont download it "
Hope this helps beginners and code layman like me.
Answered on: Android Studio project detected

phonegap development, What is the easiest way to add plug-in?

I have just started with phonegap using below link.
http://docs.phonegap.com/getting-started/1-install-phonegap/desktop/
I have followed all steps and able to run my first phonegap app successfully.
I was really excited till now, but now I am stuck when i want to add plug-in(Speech Synthesis) to same app. doing some google, i found that, i need to install below things. Is there any other easy way for this?
Install Java (Set the path in environmental variables)
Download ADT Bundle and extract it and set the path in environmental variables.
Download and install Node.js from http://nodejs.org/ link. (Set the path in environmental variables if not set automatically)
Download Apache ANT.
Also step by step links for above steps are broken, please suggest the correct and easiest way to add plug-in to phonegap application.
I found it myself now..
below are the steps..
Install npm from https://nodejs.org/en/
Install phonegap CLI with below command
$ npm install -g phonegap
Instal GIT if not installed on your desktop fro their site or using below command.
npm install -g git
Add plugin using below command at the project directory
phonegap plugin add https://github.com/macdonst/SpeechRecognitionPlugin
phonegap plugin add https://github.com/apache/cordova-plugin-battery-status
Open your project again in Phonegap desktop app or use phonegap serve command to test it directly on mobile app.
No need of eclipse, ant, java....

Embedding Cordova webview on Android (Windows 7 development environment)

I have followed the these instructions to setup Android 4.4 SDK, Eclipse and Cordova 3.5 on my Windows 7 PC. The only point that deviated from these instructions is that I did not download Phonegap from a zip file, rather I installed it using:
npm install -g cordova
as per these instructions. Everything installed fine and I was able to create a Hello World app with Cordova and launch it on my Android device. So far, so good. :)
Now, however, I am needing to go a step further and need to get Cordova embedded in my own webview using the CordovaWebView. I am trying to follow these instructions but I really am not understanding the steps outlined there. For example, on step 1 (yes, I am stuck on step 1!), it says:
Use bin/create to fetch the commons-codec-1.6.jar
What is the "create" command? Is it a Java tool? What is the exact command that I would have to type in to do the fetch and will it work on Windows?
The next step says:
cd into /framework and run ant jar
Ok. I have got Apache-ant-1.9.4 on my PC and got a path to it setup in my Windows Path environment variable, but where is the "framework" directory that I need to navigate to??
I would really appreciate it if someone could help me understand these instructions so that I can get this setup in my Windows environment.

phonegap doesn't generate platforms/android subdirectory?

Hi!
I've decided to try out phonegap but i am having trouble getting it set up with eclipse using the CLI as the guides seem to be outdated and inaccurate. Here's what i've done so far to get the phonegap project set up in eclipse:
"phonegap create hello" to create a new phonegap project
then i tried "phonegap platform add android", but gave me a 'is not a node' error
from this question i got the idea that i should instead use "phonegap build android", so i used that command.
According to the android platform guide in the official phonegap website it says that now there should be a platforms/android subdirectory in the phonegap project folder, but there isn't. The platforms folder is completely empty.
Have i missed something? Thank you very much for your help :)
Please try phonegap install android.
By just typing phonegap without any arguments you'll get the basic help and when you want to know more of a specific command do phonegap help <subcommand>
Personally I found the Cordova CLI documentation to be a little more in depth and if you're just building locally you'll have no big difference between the cordova command and the phonegap command as far as I've been able to tell. You only really need the phonegap command if you're using PhoneGap Build as well.
Example:
% phonegap
Usage: /usr/local/share/npm/bin/phonegap [options] [commands]
Description:
PhoneGap command-line tool.
Commands:
create <path> create a phonegap project
build <platform> build a specific platform
install <platform> install a specific platform
run <platform> build and install a specific platform
local [command] development on local system
remote [command] development in cloud with phonegap/build
help [command] output usage information
version output version number
% phonegap help install
Usage: /usr/local/share/npm/bin/phonegap install [options] <platform>
Description:
Installs the application for a specific platform.
Automatically detects platform SDK support and uses the correct environment.
See each environment for available [options].
Examples:
$ /usr/local/share/npm/bin/phonegap install android

Error in installation/Building of Phonegap

I am new to phonegap. I already have ADT in my PC.
1)I installed NodeJs.
2)I wrote on cmd
npm install -g phonegap
phonegap create my-app
cd my-app
phonegap run android
[phonegap]detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[error] No platforms added to this project. Please use 'cordova platform add <platform>'.
Here I already set the correct PATH. But the same problem occurring. If anyone knows plz let me know.
Thnx
Still not working .. Can anybody knows this .. Plz .. Thanks in advance..
I added these path for android: -
D:\adt-bundle-windows-x86\adt-bundle-windows-x86\sdk\platform-tools\
D:\adt-bundle-windows-x86\adt-bundle-windows-x86\sdk\tools\
and Java path is already set here.. So What's the problem here.. anyone can give the solution plz
EDIT: THIS ANSWER USES CORDOVA, NOT PHONEGAP
You must tell cordova which platforms you are going to use (e.g. android)
therefore, before executing command $cordova run android you must (once) execute cordova platform add android
For more details, see my answer here: Phonegap How to make android build
Regards, miweiss
At last I got the solution
Initially I wrote the command cordova platform add android, Then it was showing the error :
No platforms added to this project. Please use 'cordova platform add <platform>'.
I did some changes:
I change it to cordova -d platform add android
I reset all path, reset means again set my JAVA_HOME path and ANT_HOME path and then I gave the command cordova -d platform add android
then it was again showing error like There is no script engine for file extension .js. Then just use the command in commmand prompt assoc .js=JSFILE and put the command on prompt cordova -d platform add android and its done, now it contains android folder within platforms.
Thank You All for help
For Mac
just add the cordova path :
export PATH=$PATH:/usr/local/lib/node_modules/phonegap/node_modules/cordova/bin:/usr/local/bin
now add platform like :
cordova platform add android
the platform will be added.

Categories

Resources