Web mobile app opening in browser but not in webview - android

I have problem using webview. When I am opening web mobile url in android browser it is opening perfectly but when i am using webView it is not rendering any view and stuck displaying a progress bar.
I am using below code:
myWebView = (WebView) findViewById(R.id.ctn_webview);
WebSettings webSetting = myWebView.getSettings();
webSetting.setJavaScriptEnabled(true);
webSetting.setDomStorageEnabled(true);
webSetting.setAppCacheEnabled(true);
webSetting.setBuiltInZoomControls(true);
webSetting.setJavaScriptCanOpenWindowsAutomatically(true);
webSetting.setGeolocationDatabasePath("/data/data/<my-app-pkg>/databases");
webSetting.setGeolocationEnabled(true);
webSetting.setDatabasePath("/data/data/<my-app-pkg>/databases");
webSetting.setDatabaseEnabled(true);
webSetting.setAllowFileAccess(true);
myWebView.setWebViewClient(new WebViewClient());
myWebView.loadUrl(myUrl);
Please note that the page is behind login credential so it redirects to many url in between to reach final page. The login page workes perfectly and after authentication i am redirected to final page where I see a round progress moving (image below). There it should render many buttons and form stuff.
Also when I am opening the same url in the browser in emulator it is working perfectly.
I dont know what I am missing. Please help.

Related

Android webview Load url doesn't work for Instagram webpage

I realized that not working for under android 4.3 versions.
I have an android app which has webview. When i try to load url "http://instagram.com" it's not working It shows blank page but facebook webpage is working.
It's really important for me please help.
WebView view = (WebView) findViewById(R.id.webView1);
view.getSettings().setJavaScriptEnabled(true);
view.loadUrl("http://www.instagram.com");
Have you tried using the method:
setDomStorageEnabled();
Sets whether the DOM storage API is enabled. The default value is
false.
for example:
WebView view = (WebView) findViewById(R.id.webView1);
view.getSettings().setJavaScriptEnabled(true);
view.getSettings().setDomStorageEnabled(true);
view.loadUrl("http://www.instagram.com");
I had previously problems loading Facebook and Twitter pages in some devices, solved using setDomStorageEnabled() method.

Android Webview doesn't load

I have a problem with Android Web view.
The slider work fine with Apple but doesn't load on Android WebView.
Can anyone help? www.pgc-usa.net/ivynails
Thanks
I think I know. Web views in Android by default do not have JavaScript enabled. This is because there is someway it can do harm to the app. To enable it though it takes two lines
WebSettings webSettings = yourWebview.getSettings();
yourWebview.setJavaScriptEnabled(true);
You can also set it so that links that are clicked open in the web view. ( Otherwise they open in browser.) to add this you just add
yourWebview.setWebViewClient(new WebViewClient());
All that together will make it come to this:
WebView yourWebview = (WebView) findViewById(R.id.myWebview);
yourWebview.loadUrl("http://www.pgc-usa.net/ivynails");
WebSettings webSettings = yourWebviewgetSettings();
webSettings.setJavaScriptEnabled(true);
yourWebview.setWebViewClient(new WebViewClient());
You can find out more by visiting this page on the Android developer site by clicking this link.

Android Webview for videosteams?

I am using a webview to connect to an ip camera. It works when I need snapshots , but i get a white screen when I try to get videostreams. I tried .getPlugins as well. What could be the possible reason?
mWebView = (WebView) findViewById(R.id.webView1);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("http://<ipaddress>/videostream.cgi?user=&pwd=");
you can call Browser activity and set specific URL by intent. Take a look here: Sending an Intent to browser to open specific URL

Force webview to open urls inside application - android app

How to force WebView to open all the urls inside the application?
You need to override the WebViewClient for your WebView.
See here for the details: it's pretty straight forward.
Notice Step 6 in particular.
To open links clicked by the user, simply provide a WebViewClient for
your WebView, using setWebViewClient(). For example:
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.setWebViewClient(new WebViewClient());
That's it. Now all links the user clicks load in your WebView.

WebView Problem on Youtube site in Android?

i tried to load the url ww.youtube.com on my app in a webview. but it cant be load completely. it loads just like below image. in the browser it loads comfortably. why? Any Idea?
image http://www.freeimagehosting.net/uploads/d7356dd8e1.png
the simple answer is to call the youtube app thats loaded on every phone with your webview. check out the code on http://fluxkore.com/index.php/android-apps/ to call the youtube app.....
Enable JavaScript! =)
myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.loadUrl("http://www.youtube.com");
It might be a problem with WebViews - WebViews aren't fully fledged browsers, and have limited functionality. For example, the reference page specifically says that WebViews don't handle JavaScripts. If JavaScripts, Flash or something like that is required to properly load YouTube, then that could be why the WebView doesn't handle it properly.

Categories

Resources