I have a Javascript code for Mozilla Firefox which insert a link in different websites when they have a special condition. I was thinking to do an app to do the same in my Android mobile phone. I have done an app which loads an URL and I can see this website in a webView. Now, I would like to insert my JavaScript code with the intention of do the same but I do not how to do it.
public void onCreate(Bundle InstanceState)
{
super.onCreate(InstanceState);
setContentView(R.layout.main);
webBrowser = (WebView) findViewById(R.id.webkit);
webBrowser.getSettings().setJavaScriptEnabled(true);
webBrowser.loadUrl("http://www.onekin.org");
}
I have seen that I should use this function but it has been impossible to let it work
addJavascriptInterface(Object object, String name)
Does somebody know how I can do it? Thanks