Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 2.64 KB

what-are-plugins.md

File metadata and controls

60 lines (39 loc) · 2.64 KB

What is a Cordova/Phonegap Plugin?

Date: 2016-02-29
Last Update: 2016-03-04

If you have worked in software development for a while, you are familiar the concept of "plugins". However, what exactly is in a plugin varies from software platform to platform.

In short, the ''Cordvoa/Phonegap Plugin'' is

  • a library of system calls
  • written in the native language
  • which has a "bridge" from the native language to Javascript
  • and is stored in repositories for ease of use.

The System Calls

The system calls can be any software or service on the device, such as:

  • displaying a text messge in a window (like Toast)
  • accessing the hardware (like the GPS)
  • accessing a network (like the Internet)
  • login into facebook (or Twitter)
  • connecting to online adversting companies (like Urban Airship)
  • access local databases (like indexedDB or SQLite)

native language

  • Java (android)
  • Objective C (iOS)
  • C# (Windows)
  • C/C++ (others)
  • NOTE: There are instances where the plugin can be all Javascript simply a wrapper for the native version of the library.

The Javascript bridge

In short, each platform (Android, iOS, Windows, etc) has code in the webview (the library to display HTML) that can be call with Javascript. The code is then sent to the native "middle-man" which then calls the system with your request. The bridge is now filtered, but you should take reasonable precautions - like understanding the whitelist system

The repositories

There are two sets of libraries to platform.

One set is refered to as the "core" plugins. These are written and maintained by the Cordova team. The other set is know as 3rd-party plugins. These are written by other people. The 3rd-party plugins are maintained and fixed by the authors - which also handle any questions regarding their plugins.

For Phonegap Build, a cloud-based build service by Adobe/Phonegap, these are the links to the respositories.

For Cordova/Phonegap CLI and SDK (including IDEs), these are the links to the respositories.

Documentation

History

  • jcesarmobile pointed out that some plugins are actually wrappers.