Plugins have changed a bit in the recent release, instead of the PluginClass extension, it now extends CordovaPlugin. You can find how to create plugins in white papers.
Link to android plugin development guide
public class Echo extends CordovaPlugin { @Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { if (action.equals("echo")) { String message = args.getString(0); this.echo(message, callbackContext); return true; } return false; } private void echo(String message, CallbackContext callbackContext) { if (message != null && message.length() > 0) { callbackContext.success(message); } else { callbackContext.error("Expected one non-empty string argument."); } } }
manishkumar Feb 20 '13 at 6:46 2013-02-20 06:46
source share