Android WebView JavaScript From Assets
Answer : Answer: 1. You MUST load the HTML into string: private String readHtml(String remoteUrl) { String out = ""; BufferedReader in = null; try { URL url = new URL(remoteUrl); in = new BufferedReader(new InputStreamReader(url.openStream())); String str; while ((str = in.readLine()) != null) { out += str; } } catch (MalformedURLException e) { } catch (IOException e) { } finally { if (in != null) { try { in.close(); } catch (IOException e) { e.printStackTrace(); } } } return out; } 2. Load WebView with base URL: String html = readHtml("http://mydomain.com/my.html"); mWebView.loadDataWithBaseURL("file:///android_asset/", html, "text/html", "utf-8", ""); In this particular case you should have all .js files you want to use on the page to reside som...