Trouble having java and javascript interact
<p>I have seen several questions similar to mine, but none seem to quite answer my question. </p>

<p>I have some javascript in my assets folder, and i want to use a WebView (or any other way that works) to bind a java object to it so that my server can send updates to my js, and then have my js call my java object. </p>

<p>I have tried loadUrl() and loadDataWithBaseURL() and neither seem to work, I use the getURL() after setting it to check it and it always returns null. After looking at the other questions, I can tell I'm referencing the path correctly (or at least the same as them). </p>

<p>I should note that it is a .js file, not an html file with js in it. However, I haven't seen anything saying that doesn't work / I shouldn't do that. </p>

<p>Here is my code to set it:</p>

<pre><code>    interacter = (WebView) findViewById(R.id.interact);
    interacter.getSettings().setJavaScriptEnabled(true);
    interacter.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    interacter.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
    interacter.setClickable(true);
    interacter.addJavascriptInterface(game, "Android");
    //loadDataWithBaseURL was here
    Log.i("Path is", interacter.getUrl() +" ");
</code></pre>

<p>Am I doing something wrong, is there a better way to do it, does this even work?</p>

<p><strong>EDIT</strong></p>

<p>I noticed used the loadDataWithBaseURL() wrong (the commented line in my code was where it was), and I am looking into that at the moment. Help on this still appreciated </p>
