Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
ForcePlugin Class
All classes in thecom.salesforce.androidsdk.phonegap package are intended for hybrid app support. Most of these classes implement Javascript plug-ins that access native code. The base class for these Mobile SDK plug-ins is ForcePlugin. If you require your own Javascript plug-in in a Mobile SDK app, extend ForcePlugin, and implement the abstract execute() function.
ForcePlugin extends CordovaPlugin, which works with the Javascript framework to let you create a Javascript module that can call into native functions. PhoneGap provides the bridge on both sides: you create a native plug-in with CordovaPlugin and then you create a Javascript file that mirrors it. Cordova calls the plug-in’s execute() function when a script calls one of the plug-in’s Javascript functions.