android - Plugin class is deprecated in Phonegap -
i had observed plugin class in phonegap deprecated , replacement of plugin now, how can communicate between java , javascript out using javascript interface class , plugin class
thanking
the plugins have changed bit in recent release, instead of extending pluginclass extends cordovaplugin. can find how create plugins in official docs.
link 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); homecoming true; } homecoming false; } private void echo(string message, callbackcontext callbackcontext) { if (message != null && message.length() > 0) { callbackcontext.success(message); } else { callbackcontext.error("expected 1 non-empty string argument."); } } }
android cordova
No comments:
Post a Comment