As I understand, WebGL is only supported in WebView in Android Lollipop (updating the WebView component in the Play Store), and newer versions (no Play Store update required).
However, I have an emulator using Android 7.1.1, and WebGL is not working. http://webglreport.com says "This browser supports WebGL 1, but it is disabled or unavailable.". I have also tried an Android 6.0 emulator, with the same result.
WebGL works fine in the emulator when using Chrome, but not in a WebView.
WebGL works fine in a WebView in a physical 6.0 phone.
What could be the reason why WebGL is not working in the same emulator, when using a WebView?
This turns out to be a limitation of the current version of the emulator: https://code.google.com/p/android/issues/detail?id=229984
Related
How to enable WebGL in WebView widget for Android 5.1.1 emulator? I checked WebGL status through Webglreport and the result was "This browser supports WebGL, but it is disabled or unavailable. Sometimes this is the result of older video drivers being rejected by the browser. Try updating your video drivers if possible".
I also tried to use Crosswalk webview on Android 4.4.4 emulator and there were same problems, but I fixed it by adding xwalk-command-line xwalk --ignore-gpu-blacklist. Is it possible to make something similar for standard WebView widget?
UPDATE: The WebView team says WebView does not allow gpu blacklist override, now or in future plans, due to security/stability risks: more details.
//
Chrome for Android 47 and Chromium/WebView 47 use different gpu blacklists and/or bug workarounds. What is allowed to successfully render in one may not be allowed to successfully render in the other even on the same hardware. Both browsers are scheduled to release updates to the Play Store every 6 weeks.
For example: I have a Nexus 10, Mali T-604 tablet (Lollipop 5.1.1. Also, Android Studio 1.5.1 with SDK 6.0 Marshmallow API 23 or 22).
In Chrome for Android --
chrome://flags, #ignore-gpu-blacklist NOT enabled, and all reset defaults
chrome://gpu, "graphics feature status-WebGL: Hardware accelerated" and Reset notification strategy 0x0000 surprisingly (see this last Crosswalk related) answer
webglreport, "This browser supports WebGL 1"
get.webgl.org, cube spins
In WebView --
webglreport, "This browser supports WebGL 1, but it is disabled or unavailable. Sometimes this is the result of older video drivers being rejected by the browser. Try updating your video drivers if possible."
get.webgl.org, "Hmm. While your browser seems to support WebGL, it is disabled or unavailable. If possible, please ensure that you are running the latest drivers for your video card."
chromium blacklist (link from Khronos WebGL blacklist wiki): "GPU rasterization and canvas is blacklisted on Nexus 10".
chromium bug list (link from Khronos WebGL blacklist wiki): "The Mali-Txxx driver does not guarantee flush ordering" and "The Mali-Txxx driver hangs when reading from currently displayed buffer".
The Pixel C tablet has a Nvidia Tegra X1 which does not appear on the chromium lists, and I've confirmed that it does support WebGL in WebView.
I have written a webview app which opens a web url. However the experience is just like when I have opened it in the default web browser of my Samsung S3 phone (android ver 4.2) which is very poor (e.g. google map cannot be displayed). Is there a way to force the webview app to use other browsers that default one, for example using Chrome browser that i installed in my smartphone?
With Android 4.4, the WebView was switched to be based on the Chromium project. Prior to that it was an Android's specific implementation of WebKit. With Android 5.0 the WebView is now updatable without OS updates through the Google Play Store.
https://developer.chrome.com/multidevice/webview/overview
If you want consistent behavior in your WebView across multiple versions of Android you'll need to include your own browser engine. Once such project is Crosswalk.
What is a difference between intel xdk, appmobi, and crosswalk?
I'm trying to render some WebGL in my PhoneGap/Cordova app but I'm having no luck.
var canvas = document.createElement('canvas');
var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
if (!gl) {
console.log('WebGL not supported');
}
The gl variable is always null.
I've tried with a OnePlus One and a Nexus 5 which are both Android KitKat v4.4.4 Chrome 38.
The same code works fine on iOS8 and on a desktop.
The code works on a normal webpage loaded in chrome on those devices. So does http://get.webgl.org/
I've even tried using CCA which uses crosswalk to bundle Chrome into the app.
I've tried Googling bug I'm flooded with people having problems from when devices didnt support it (iOS < v8 and Android < v4.4).
I'm thinking that it might be something that I have to enable in the build chain.
Thank you in advance.
Glen
I've figured it out with some help.
Even though I have Chrome 38 installed, the WebView is actually not using the installed chrome version but another version that ships with the OS and doesn't auto update.
The WebView is actually Chrome 33 which doesn't support WebGL.
When Android L comes out, it will support WebGL in the WebView which will automatically update too.
In regards to the CCA version, it bundles Chrome 37 which supports WebGL. It works on devices that don't have blacklisted GPUs. If you follow these instructions it tells you that you can make it ignore the blacklist and run on all devices but might have unstable results.
If you want to use WebGL on Android 4.0+ Ludei (http://ludei.com) has a project called WebView+ that allows you to use the latest Chromium project on Android. The drawback is that 15Mb are added to your final APK. You can test it using the CocoonJS Launcher App: https://play.google.com/store/apps/details?id=com.ideateca.cocoonjslauncher&hl=es where you can point to a URL (even use a QRCode so you do not have to type the whole URL on a mobile device) or even upload a whole ZIP file with your project to test it off-line.
I need to display WebGL graphics in my webview. Is there any way to modify Android WebView to enable WebGL. If yes, How?
WebGL was not supported in WebViews before Android Lollipop. In KitKat, Android switched to Chromium as the native WebView implementation, but it is locked to Chromium 33, with no WebGL. In Lollipop, WebView is updated via the Play Store, and now supports WebGL. (source: https://developer.chrome.com/multidevice/webview/overview)
Trying to extend WebView to support it is next to impossible.
One thing you might consider, is use CSS 3D transformations instead of WebGL, those are supported on Android ICS and forward, see http://caniuse.com/#feat=transforms3d
WebGL is not supported in current Android webview, you can however use crosswalk-project which is a web runtime that supports WebGL and package it in a android app along with your WebGL app. The latest Intel XDK supports building Android apps with crosswalk runtime.
You can view WebGL on new Android devices using the Chrome Beta app or Firefox beta app. The only device I have tested and this worked on is the Asus Nexus 7 tablet running Android 4.2.2.
My Motorola Razr running Android 4.1.2 does not support WebGL with google Chrome Beta.
Not sure if this directly helps.. but FYI.
Although it is not possible to enable WebGL for Android WebView, there is an option to have native apps using WebGL for rendering using CocoonJS by Ludei (www.ludei.com). They even have a demo app in Google Play to show some known WebGL demos running even in Android 2.3 devices.
https://play.google.com/store/apps/details?id=com.ludei.demos.webgl
Even running on OUYA!
http://www.youtube.com/watch?v=ypyqkAo1jgo
I have chrome version 28.0 on OS 4.2.2 WebGl is not enabled by default you need to enable it by typying chrome://flags/ in seach bar just the way shwn in pic below
Once you have enabled web gl relaunch chrome and you will be able to run most of three.js experiments . I have shared screenshots for few :-
I also tried everything on webview but I was unable to set webgl flags. Probably it is not possible to use webgl in webviews .
We are using WebView to play local SWF files in our Android app.
WebView webview=(WebView)findViewById(R.id.web_play);
File decfile = new File("/mnt/sdcard/flashplay/temp/test.swf");
Uri uri = Uri.fromFile(decfile);
if(decfile.exists()){
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setPluginsEnabled(true);
webview.getSettings().setAllowFileAccess(true);
webview.loadUrl(uri.toString());
}
The code does not work in Jelly Bean, we have the flash plugin installed and able to play flash videos in Browser. But no luck in getting it played within our app in a WebView in Jelly bean.
First: Flash is no longer supported in since Android 4
Second: Chrome does not support the flash player
Third: You can install (with no guarantee) older flash versions on Android 4 manually and use it in the standard Browser.
Get old versions of flash from adobe here:
http://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html
just download the apk and open it. make sure you are trusting apks from other sources.
edit: on my device (samsung galaxy nexus with android 4.1.2) it works just fine.
alternatively there are a dozen other local flash players in the market. you can try to integrate them.
jelly bean and ics not support adobe flash and low versions only support flash like 2.3,2.2,2.1!
Adobe Systems also remove adobe flash app in google play shop!
"If a device is upgraded from Android 4.0 to Android 4.1, the current version of Flash Player may exhibit unpredictable behaviour, as it is not certified for use with Android 4.1," Adobe said.
Flash ICS some device working but,not working all devices properly!