How can we add javascript interface to CordovaWebView


#1

How can we add javascript interface to CordovaWebView to call the native functions.
I am using latest version of cordova.

In previous version of cordova I used to add the javascript interface to the webview like below code but I could not find the way to do this in latest version of cordova.

appView = (CordovaWebView) findViewById(R.id.mainView);
appView.addJavascriptInterface(this, "JSInterface");
 appView.loadUrl("file:///android_asset/www/Index.html" );