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

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....

Related

To add android in phonegap platform using cordova [duplicate]

Helo,
I am currently trying to build the base phonegapp android app that's automatically created, so I navigated to the directory... but when I use the command
phonegap build android
I just get this random error, as shown in the attatched picture.
Extra info
I am currently on Windows 8, and am completely new to making apps, and am new to the command line as well. Not very familiar with this stuff...
What I'm trying to do would be called 'compiling', right?
Yeah, I had the same problem yesterday - but with a little help of a colleague I got it!
Step by step tutorial (for Windows)
Install node js
Install phonegap using command line: npm install -g phonegap
Install Android SDK
Launch Android SDK Manager and install Android 4.4.2 (API19)
Because latest phonegap/cordova version requires this
Documentation for Android SDK and SDK Platform should be enough
Also update already existing packages
Create an environment variable called ANDROID_HOME which points to destination of Android SDK. e.g. C:\Users\You\AppData\Local\Android\android-sdk
Download Apache Ant and extract the archive somewhere
Create an environment variable called ANT_HOME which points to destination where you have extracted Ant
Install JDK (Java Development Kit) for your System. Before you are able to download, you have to accept the licence
Create an environment variable called JAVA_HOME which points to destination of JDK
If you want to add plugins via phonegap automatically you should also install GIT.
Last but not least you need to add the following directories to PATH environment variable:
%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%JAVA_HOME%\bin
Each folder is separated by a semicolon
Setting environment variables will take effect just for new command line windows. So you should reopen it, after the whole process.
Easy, isn't it? ;-)
Now you can use phonegap build android after you've created a new phonegap project. If you have your smartphone plugged via USB and installed the USB drivers, and activated the USB Debugging on smartphone, you may use
phonegap run android
And the ready build APK will be transfered and executed on your smartphone. Perfect for testing.
If you want to create a final release APK, go to
YOURPROJECT\platforms\android\ant-build
and enter ant release.
You'll find the final APKs in YOURPROJECT\platforms\android\bin.
They are unsigned, here is a Noob guide to signing an APK.
I have tested a Barcode Scanner example, and it works seamlessly.
Have fun!
also check android in cmd, if it says: 'xcopy' was not recognized.
then add to your path:
%SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;
Armin's guide is perfect. But if you still fail you can do this.
Phonegap platform files stay in C:\Users[username].cordova\lib folder. Go there and remove android/ios/bb... driectory.
For best result run this command:
npm cache clear
After that try again, clean platfrom files will be download and build your project.

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.

Issue with installing phonegap 3.3.0?

I am trying to install the phonegap version 3.3.0, So I have installed nodejs and I run the following command,
npm install -g phonegap
By running the above command I am getting the following error.
Can any one suggest me the solution for the above issue?
My Project creation.
You need to install git and make sure that git paths are available on system variable path. Most likely path will be set all by itself with install.
Git Link

How do I install Phonegap 3.3 on Windows

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

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

Categories

Resources