is there a way to call native java code from a webview in Android other than using addJavascriptInterface?


There is a bug with the Gingerbread distribution and the addJavascriptInterface method described here:

Although there are some workarounds for the issue like this:

or this:

All of them are partial-fixes with some holes in them.

So I wonder if there is another way to avoid the addJavascriptInterface method to invoke native code from the html inside the webview.

Thanks in advance!


I hope and I trust there is no way to call native code expect addJavascriptInterface(), because that will be big security-exploit in Android. Nobody should be able to call native code from browser – that could cause many different abuses.

Answered By – TN888

Leave a Comment