Jquery datepicker not showing in Android Webview. Works in native browser - android

I'm trying to embed an HTML page in a webview. The page has some jquery and javascript. When an input field is clicked it brings out the jquery datepicker. It works well in the native browser but, doesn't work in the webview. I did set enableJavascript to true but still not showing. So I'm not sure how it works if opened in the native browser, but not if is in webview. Am I missing anything? Any help is appreciated. This is my code:
myWebView = (WebView) findViewById(R.id.webView);
//Enable Javascript
WebSettings webSettings = myWebView.getSettings();
webSettings.setLoadWithOverviewMode(true);
//Enable DOM Storage
webSettings.setDomStorageEnabled(true);
//Enable Zoom
webSettings.setBuiltInZoomControls(true);
//I was adviced to place some of this to handle page navigation:
myWebView.setWebChromeClient(new WebChromeClient());
myWebView.setWebViewClient(new WebViewClient());
//other settings
myWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setScrollbarFadingEnabled(false);
//finally, load url
myWebView.loadUrl("https://www.mycustomurl.com");

You have to enable Javascript in your webview...
like this,
WebView.getSettings().setJavaScriptEnabled(true);
in your code, add this too..
webSettings.setJavaScriptEnabled(true);

Related

Advanced webview not loading URL properly

I am using advanced webview in my app. I followed the steps as listed in https://github.com/delight-im/Android-AdvancedWebView.
The problem is , the webview is not loading the URL properly, meaning that, the screen is not aligned properly and in few websites, I am not able to click the buttons.
I use myWebView.getSettings().setJavaScriptEnabled(true); in my code.
Will setJavaScriptEnabled work in advanced webview?
JavaScript and WebStorage are enabled by default according to Github repository:
https://github.com/delight-im/Android-AdvancedWebView
Did you try this?
mWebView = (AdvancedWebView) findViewById(R.id.webview);
mWebView.setListener(this, this);
mWebView.loadUrl("http://www.example.org/");
If that is not working try this use case as for normal WebView
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);

i Cant Select file in my own browser in android

I have created an android app for a simple website view (Using webview) but I can't select file using
I am trying to make a app which completely load the website made using php
use your Web view in this way .
webview =(WebView) findViewById(R.id.webView);
WebSettings webSettings=webview.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setDatabaseEnabled(true);
webview.setWebViewClient(new WebViewClient());
webview.loadUrl(url);

webpages not loading properly in android webview

I want to load a website in android webview which has pretty good design but in webview only html content is showing. I don't have experience with Web but I think the CSS is not loading.
webView = (WebView) findViewById(R.id.webView);
webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setDomStorageEnabled(true);
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
webView.loadUrl(myURL);
webView.setWebChromeClient(new ChromeClient());
webView.setWebViewClient(new MyWebViewClient());
Its working fine in iOS webview and in browsers.
Please help. Thanks!

Webview blank page quakenet

Before read my post, I try to search, but I didn't resolve my problem.
I use a webview for QuakeNet IRC WebChat
WebView myWebView = (WebView) findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setDomStorageEnabled(true);
myWebView.loadUrl("http://webchat.quakenet.org/");
myWebView.setWebViewClient(new WebViewClient());
I have a blankscreen.
But when I try to load http://www.google.com, that's work.
I have try to enable JS, but it's not this.
Can you help me pls.
Thank you :)
The chat on the website seems to use websockets.
According to this post: WebSocket in Android WebView websockets are not supported natively on android webview.
Check your logcat for errors.
You can try to follow this link and change your code http://foretribe.blogspot.it/2013/08/how-to-make-android-webview-support.html

Android WebView can't display jquery-fullpage page properly

The page is implemented by jquery-fullpage plugin, like this:
http://alvarotrigo.com/fullPage/#firstPage
In android app, WebView doesn't display it properly. It overlaps all the sub pages in one page without scrollbar.
Any idea?
Version of your browser maybe affect. Check issue on Github.
Remember enable javascript in your WebView:
WebView webView = (WebView) findViewById(R.id.webview);
webView = (WebView) findViewById(R.id.webview);
webView.clearCache(true);
webView.clearHistory();
/* Enabling javascript */
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);

Categories

Resources