I have an application that makes use of the Android WebView, as well as some JavaScript. When my WebViewClient calls onPageFinished()
, I alert my JavaScript to run
In the end I used the values from webView.getHeight()
and webView.getWidth()
, adjusted them for screen density, and passed them in as arguments into a javascript method via webView.loadUrl()
. This was the only way I could be sure I was getting the right values.
Doing what was suggested in the comments above, checking for the width of 320, and the height of 240 will work great... until you run on a device with those exact dimensions.