How to use Plugins with PhoneGap and PhoneGap Build - ?

  • 2
  • Question
  • Updated 9 years ago
  • Answered
Hi,

In the PhoneGap documentation for Android it is said that to use a Plugin one would need 3 things:

1. The correponding java/jar installed
2. The corresponding plugin javascript installed and linked
3. A corresponding "plugin.xml" file placed in the /res/xml folder

Is it so that the PhoneGap APIs listed in the site are built-in i.e. they come with the phonegap.jar and phonegap.js with the regular distribution? When I search in the phonegap.js (0.9.6) I see code for the accelerometer etc. so I assume everything is there. But the "plugins.xml" did not come with the PhoneGap 0.9.6 so that made me wonder. On the other hand, plugins.xml came with PhoneGap 1.0.0rc2.

And for PhoneGap Build:

This makes me also wonder how this is managed in PhoneGap build as there are no means on the developer side to state which APIs he is using by including a "plugins.xml" file. The one only thing that the developer can/must do is implement the particular code for the API he intends to use in his included javascript. If he would like to use a "third" party plugin with PhonGap Build it becomes even more "confusing" as he would need to include java/jar and the plugin.xml file where actually there are no provisions to do so.

Anybody?
/Ralf
Photo of Ralf Gummerus

Ralf Gummerus

  • 37 Posts
  • 1 Reply Like

Posted 9 years ago

  • 2
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
The PhoneGap plugins documentation has been extensively overhauled over the past few days - you can access it here:
http://wiki.phonegap.com/w/page/36752...

You should be able to get further help about using plugins on the PhoneGap Google Group.

PhoneGap Plugins are not currently supported on PhoneGap Build - please see one of the existing topics for further discussion, such as this one:
http://community.phonegap.com/nitobi/...
Photo of Ralf Gummerus

Ralf Gummerus

  • 37 Posts
  • 1 Reply Like
Hi Andrew,
Well sorry for bothering you with this one (I did post on the Google group because the issue concerns PhoneGap as well as PhonGap build).

I did read all there was to read at both locations you advised before i asked. Now, You gave me the answer with respect to PhoneGap Build - confirmed.

The issue concerning PhoneGap you might be able to answer also even though you are on the build side: Is everything I need to have for using the standard API's (accelerometer, files, notifications...) delivered with the PhoneGap distribution 1.0.0RC2? I am building for Android, does not have Apple stuff yet.

Thanks
/Ralf
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
No, you do not need to include any extra plugins for the standard PhoneGap APIs.

PhoneGap 1.0.0 is now out, so you can upgrade to be sure - I'm not sure if there were any issues with the RC2 for Android.