0

Im trying to work with android's webview to show website that is implemented with sencha touch.

The website works fine on my built-in browser / chrome / desktop, but when I use my webview, it will stuck at the first page. The website is implemented such that at first a "loading indicator" is shown, while all .js dependencies are being downloaded. there's a callback Ext.require(classes, this.onDependenciesLoaded, this); in the code which then, removes the indicator and draws the website. It seems that in my webview it wont get to onDependenciesLoaded (I always see the indicator, even after download is complete)

Is there a way to debug the webview itself, similar to developer tools?

This is how I initialize webview:

//get webView
webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
//Allow running JS code
webView.getSettings().setJavaScriptEnabled(true);
//JS->JAVA interface
webView.addJavascriptInterface(new JSInterface(this), JAVASCRIPT_INTERFACE_OBJECT);
//Allow Zoom
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setSupportZoom(true);

I have tried some other settings enabled, yet nothing seemed to help, so I stick to the basic version of my code.

buddy123
  • 5,679
  • 10
  • 47
  • 73
  • Is this a remote site, or is it html content bundled in your app? For debugging, you will have to trawl through logcat for the webclient errors, console.log statements usually show up for me if you want to set a bunch of them to trace the execution. (i cant remember if this is by default of if i set something up for it, see here http://stackoverflow.com/questions/11373491/android-logcat-is-not-working-for-js-console-log) – Leonard Feehan May 12 '14 at 11:03
  • Ok, I looked further and I see the problem. in the website code they remove the loading screen using `Ext.get("Indicator").dom.remove();`. That same line number appears in logcat: `E/Web Console﹕ Uncaught TypeError: Object # has no method 'remove'` – buddy123 May 14 '14 at 20:24

0 Answers0