Muhammad Ali Muhammad Ali - 19 days ago 5
Android Question

Issues in loading Angular JS website in Android Webview

Hi EveryOne I am trying to load GTV into Android WebView.It loads in Mobile browser quite well but not in webview.
Here is my Code.

WebView theWebPage = new WebView(this);
theWebPage.getSettings().setJavaScriptEnabled(true);

theWebPage.getSettings().setPluginState(WebSettings.PluginState.ON);
super.onCreate(savedInstanceState);
getSupportActionBar().hide();
setContentView(theWebPage);
WebViewClient client = new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return false;
}
};
theWebPage.setWebViewClient(client);


// client.onPageStarted(theWebPage);

theWebPage.loadUrl("http://gtvqa.com/#!/");

Answer

AngularJS requires an HTML5-compliant browser and I don't think that the default Android WebView is. Unless you are the developer of that website and can add modernizer to the page to attempt to account for older, non-compliant browsers, you might not be able to solve this.

Comments