Search code examples
androidcordovapluginsphonegap-desktop-app

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?

  1. Install Java (Set the path in environmental variables)
  2. Download ADT Bundle and extract it and set the path in environmental variables.
  3. Download and install Node.js from http://nodejs.org/ link. (Set the path in environmental variables if not set automatically)
  4. 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.


Solution

  • I found it myself now..

    below are the steps..

    1. Install npm from https://nodejs.org/en/

    2. Install phonegap CLI with below command

      $ npm install -g phonegap

    3. Instal GIT if not installed on your desktop fro their site or using below command.

      npm install -g git

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

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