As the following documentation here: http://docs.phonegap.com/en/3.5.0/guide_platforms_android_plugin.md.html#Android%20Plugins
I override an method
@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
if ("beep".equals(action)) {
this.beep(args.getLong(0));
callbackContext.success();
return true;
}
return false; // Returning false results in a "MethodNotFound" error.
}
And call it from Javascript like this:
cordova.exec(<successFunction>, <failFunction>, <service>, <action>, [<args>]);
Above java native code only return an boolean result. How to make it return an string ( or JSON ) and make cordova.exec() receive it ?
p/s: I want to use java native code read a JSON string (List of items) from email. And it will return to Javascript code to render to an list in Sencha Touch