This is a migrated thread and some comments may be shown as answers.

WebGL issues on Android

1 Answer 333 Views
Google Android
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Zinc
Top achievements
Rank 1
Zinc asked on 05 Nov 2015, 03:19 AM

I have some code that uses WebGL (using the three.js library). Everything works fine in iOS but it won't work on Android. I've only tested it on a Samsung Galaxy S5 (Android 5.0) and a Samsung Galaxy S3 (Android 4.4.4).  The code isn't complicated, mostly based on Google demo code.

The error I get is:

[chromium] "Error creating WebGL context." at file: js/three.js (25050)
[chromium] "Uncaught TypeError: Cannot read property 'getExtension' of null" at file: js/three.js (25054)

I've turned on Android Hardware Acceleration (and tried with it off). I also tried setting Cordova 4.0.0 and 3.7.0 setting in AppBuilder. 

I've tried going to the Chrome app and WebGL is enabled - I looked at chrome://flags and chrome://gpu and can't see any problems. I did this on both the Chrome app (Chrome version 46.0.2490.76) and the default browser app (Chrome 34.0.1847.76). I also tried changing Cordova's WebView to Crosswalk.

I've played with just the web browser (Chrome) and some WebGL demo pages, some work, some don't. 

I also tried the same code on a web page running on the Chrome browser and it works. So I'm sure the code is right (and the fact that everything works on iOS), and that the phone does support WebGL because it works in a browser.

So what I really need is a way to get Cordova (using AppBuilder) to use WebGL on Android. Any ideas? 

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 09 Nov 2015, 05:25 PM
Hello,

We haven't had similar issues reported on our side and I am not familiar with the Android limitations with the three.js library. I looked around the net for similar reports and I noticed that there are a couple but I wasn't able to find a specific solution.

As far as a webview goes, Crosswalk supports WebGL while not all WebView versions do. With that in mind, I am not sure why even changing the webview doesn't work on your side. It might be best to post these errors in the three.js repository issues section so that their community can help you find a solution.

Alternatively, if you can provide me with a sample project or a link to the example you're trying to run, i can try to investigate this behavior further on our side and see if we can find a solution. Still, please keep in mind that as this behavior doesn't seem to be specifically related to the AppBuilder environment, I cannot tell for sure to what extend I will be able to assist you find a solution with the three.js library implementation.

Regards,
Tina Stancheva
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Google Android
Asked by
Zinc
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or