Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling WebGL support for Android WebView

I need to display WebGL graphics in my webview. Is there any way to modify Android WebView to enable WebGL. If yes, How?

like image 938
arun8 Avatar asked Mar 13 '13 19:03

arun8


People also ask

Why is WebGL not supported on mobile?

We should note, that Unity WebGL is not officially supported on mobile devices. That's because it works in high end phones and tablets, but the low-end devices may not be powerful enough, may not have the required memory to support the content well, and may not provide fluent experience.


4 Answers

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

like image 86
yarons Avatar answered Oct 07 '22 20:10

yarons


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.

like image 28
krisrak Avatar answered Oct 07 '22 19:10

krisrak


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.

like image 1
Autumn Avatar answered Oct 07 '22 19:10

Autumn


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

like image 1
Iker Jamardo Zugaza Avatar answered Oct 07 '22 18:10

Iker Jamardo Zugaza