I can't load my web application into a webview - android

I've developed my own jQuery mobile project and host it on a website, it is available here:
http://thecoffeedrinker.site11.com/Youtube%20Theater/home.html
I can use this app from my mobile browser; now I would like to wrap it into an Android Application to publish it on Google Play. So I built a simple activity consisting into a webview, where I load the url:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube_theater_wrapper);
WebView appView = (WebView) findViewById(R.id.pageView);
WebSettings webSettings = appView.getSettings();
webSettings.setJavaScriptEnabled(true);
appView.loadUrl("http://thecoffeedrinker.site11.com/Youtube%20Theater/home.html");
}
The problem is that the page is never displayed. All I get is the jQuery Mobile undefined progress bar, just like the loading is taking forever.
Is there any way to display the pages properly?

Add this to your webView:
webSettings.setDomStorageEnabled(true);
So:
WebView appView = (WebView) findViewById(R.id.pageView);
WebSettings webSettings = appView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
appView.loadUrl("http://thecoffeedrinker.site11.com/Youtube%20Theater/home.html");

try this into your java file
appView.loadUrl("http://thecoffeedrinker.site11.com/Youtube%20Theater/home.html");
appView.setIntegerProperty("loadUrlTimeoutValue", 100000);

Related

YouTube thumbnail won't load in webview

We have a WebView based android app which loads webpage consisting <a> tags linking to YouTube video.
The web app works fine in a browsers like Chrome for Android and loads thumbnail from YouTube as expected but within WebView the <a> tag won't load the thumbnail of YouTube video.
How can we force the WebView to behave similar to Chrome browser
Have tried setting clients like below, which didn't help
webview.setWebViewClient(new WebViewClient());
webview.setWebChromeClient(new WebChromeClient());
Even added hardware acceleration in AndroidManifest.xml but it didn't work either
android:hardwareAccelerated="true"
Note: JavaScript is also enabled.
Did you try to enable javascript in your webview?
You can enable it like this:
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);

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);

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);

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

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);

Android loadUrl unable to load site

My webview will works for a site such as Google.com, however, the specific page will not load.
Simply displays subscribe to feedburner (I made this site to reflect a converted news feed)
This specific webpage will display correctly in an Iphone UIWebView, but not for Android.
Some code
WebView rss = (WebView) findViewById(R.id.webviewRSS);
rss.loadUrl("www.newmanu.edu/newmannews");
Check out the source of "www.newmanu.edu/newmannews", you have to activate javascript.
from http://developer.android.com/guide/webapps/webview.html
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
Add http:// or https:// before URL.
Try this.
rss.loadUrl("http://www.newmanu.edu/newmannews");
Or
rss.loadUrl("https://www.newmanu.edu/newmannews");

Categories

Resources