androidhtmlwebviewwurfl

Android webview does not load the page but app load from browser


I have a html 5 mobile web app which load from browser fine but get stuck on android webview. We used a splash screen before loading the web app and my webview is stuck into the splash screen , does not load the home page. We are using wurfl api to detect device through user agent and i made sure the user agent is same from browser and webview as we are only going with OS name and version which is "Android" and "3.9>". Got stuck with this issue for last two days.:

    String url = http://myapp.com
    webView = (WebView) findViewById(R.id.webView1);
    webView.getSettings().setJavaScriptEnabled(true);
    progDailog = ProgressDialog.show(Activity.this, "Loading","Please wait...", true);
    progDailog.setCancelable(false);

    webView.setWebViewClient(new WebViewClient() {  
     @Override
     public boolean shouldOverrideUrlLoading(WebView view, String url) {
                 progDailog.show();
                 view.loadUrl(url);

                 return true;                
            }
                @Override
                public void onPageFinished(WebView view, final String url) {
                    progDailog.dismiss();
                }
      });
    webView.loadUrl(url);

Yes I have added the internet, wifi permission to Manifest:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Getting Exception:

webview : blockWebkitViewMessage= false (on Samsung galaxy s3)
(Nexus 5)      
 W/AwContents(15767): nativeOnDraw failed; clearing to background color. 
  I/chromium(15767): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
  I/chromium(15767): [INFO:CONSOLE(2)] "Viewport argument key "minimal-ui" not recognized and ignored.", source:

Here is another thread i found but not a solution


Solution

  • It was issue about turning local storage on by adding this line to my activity.

    webView.getSettings().setDomStorageEnabled(true);