Twitter: raymondcamden


Address: Lafayette, LA, USA

Did You Know: Searching for PhoneGap/Cordova Plugins

01-03-2014 10,731 views Mobile 6 Comments

I discovered this yesterday which means it has probably been around forever and I'm the last one to get a clue. As you should (hopefully) know by now, PhoneGap 3.0 majorly changed how you use core features. (I discussed these changes in detail here: PhoneGap 3 Released - Things You Should Know.) The biggest change that will trip developers over (and yes, it still trips me up) is the requirement to add plugins for core features like geolocation, camera support, etc.

Luckily it takes all of two seconds to do this. The issue I run into myself is that I can never remember the names of the plugins. They all have fairly simple names, like org.apache.cordova.camera for camera. But then you run into things like this: org.apache.cordova.device-motion. What feature is that? The accelerometer. Makes sense - but I would have guessed org.apache.cordova.accelerometer.

What I normally do is just pop open a tab to docs.cordova.io, find my feature, and copy out the name. The docs put the plugin name right up there at the top so it is easy to find. As simple as that is, I just yesterday discovered that the Cordova CLI supports searching for plugins. For example:

This searches the entire set of plugins at Cordova Plugins so it includes more than just the "core" set. If you want to list all the core plugins, you can try searching for org.apache.cordova, but this includes a few additional ones as well.

Unfortunately this isn't perfect. Using my accelerometer example above it won't actually find a match if you try searching for "accel". I'm going to ask around to see if there is a way to flesh out the descriptions for plugins so that searches could be a bit more useful.

p.s. I should point out that there is another PhoneGap plugin registry as well - but I'll cover that later today.

6 Comments

  • Commented on 01-03-2014 at 10:34 PM
    That's cool! I wonder how you can get your plugin listed on in that registry?
  • Commented on 01-04-2014 at 8:29 AM
    Yeah good question. It isn't described on the page.
  • Cesidio DiBenedetto #
    Commented on 01-04-2014 at 10:53 AM
    Raymond,

    I wrote an npm cli package that does the same thing but also searches http://plugreg.com. Take a look and tell me what you think.

    https://npmjs.org/package/cordova-plugins

    Cesidio
  • Commented on 01-04-2014 at 11:21 AM
    @Cesidio: I plan to - was going to cover it in my follow up. (See the PS.)
  • Cesidio DiBenedetto #
    Commented on 01-04-2014 at 11:26 AM
    Raymond,

    Apologies. Didn't notice the p.s.

    Keep up your awesome work.

    Cesidio
  • Commented on 01-04-2014 at 11:36 AM
    Heh, no worries. As it stands, folks may miss the next post (and it will take a few days, I've got a trip).

Post Reply

Please refrain from posting large blocks of code as a comment. Use Pastebin or Gists instead. Text wrapped in asterisks (*) will be bold and text wrapped in underscores (_) will be italicized.

Leave this field empty