YouTube Video not playing in WebView – Android

Add these lines before loading HTML content to your WebView. wv.setWebChromeClient(new WebChromeClient() { }); From the documentation: In order to support inline HTML5 video in your application, you need to have hardware acceleration turned on, and set a WebChromeClient. For full screen support, implementations of onShowCustomView(View, WebChromeClient.CustomViewCallback) and onHideCustomView() are required, getVideoLoadingProgressView() is optional.

Loading an Android Resource into a WebView

from this site Using the resource id, the format is: “android.resource://[package]/[res id]” Uri path = Uri.parse(“android.resource://com.androidbook.samplevideo/” + R.raw.myvideo); or, using the resource subdirectory (type) and resource name (filename without extension), the format is: “android.resource://[package]/[res type]/[res name]” Uri path = Uri.parse(“android.resource://com.androidbook.samplevideo/raw/myvideo”);

Android WebView JellyBean -> Should not happen: no rect-based-test nodes found

The issue occurs because in some scenarios WebView fails to notice that its visible rect has changed, so as far as webkit is concerned the page is still not visible. Thus all touches fall outside of the window, and get rejected. The cleanest fix is when you know the visibility of your WebView has changed … Read more

Caching in Android webview

Don’t use these: viewer.getSettings().setAppCacheMaxSize(1024*1024*8); viewer.getSettings().setAppCachePath(“/data/data/com.your.package.appname/cache”‌​); viewer.getSettings().setAppCacheEnabled(true); These have nothing to do with the default webview internal cache. Appcache is an entirely different feature mean to make you able to run the website w/o an internet connection. It does not work that great and probably you do not want to use it. With setting this: viewer.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT) … Read more

How to get loaded web page title in Android WebView?

You’ll have to use a custom WebViewClient to get this done. You will override the onPageFinished() method so when a new page finishes loading you can set the webview to the appropriate title. Below is a sample implementation of the above: WebView mWebView = (WebView) findViewById(R.id.mwebview); mWebView.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String … Read more

Android WebView, Scaling Image to fit the screen

You could also do something like this. Add CSS style for img at the beginning (depends on your web data format) of your data string. <style>img{display: inline; height: auto; max-width: 100%;}</style> To quickly do it to data in WebView i did this. WebView content = (WebView) findViewById(R.id.webView1); content.loadDataWithBaseURL(null, “<style>img{display: inline;height: auto;max-width: 100%;}</style>” + post.getContent(), “text/html”, … Read more

Android WebView not loading URL

Did you added the internet permission in your manifest file ? if not add the following line. <uses-permission android:name=”android.permission.INTERNET”/> hope this will help you. EDIT Use the below lines. public class WebViewDemo extends Activity { private WebView webView; Activity activity ; private ProgressDialog progDailog; @SuppressLint(“NewApi”) @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); activity = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)