Supporting WebGL on Android 5's WebView

后端 未结 3 1378
情书的邮戳
情书的邮戳 2020-12-21 11:51

I have a web project (depends on WebGL) which works on computers, any browser. Now I am trying this project to be opened as an application on Android based mobile phones. I

相关标签:
3条回答
  • 2020-12-21 12:15

    Except Samsung s4 with Android 5.0.1 , rest all devices return webgl true.

    • | Nexus 9 | Android 5.0 | webgl works |
    • | Nexus 6 | 5.1.1 | webgl works |
    • | htc | 4.4.4 | webgl works |
    • | samsung galaxy note 4 | 5.0.1 | webgl works |
    • | samsung s4 | 5.0.1 | webgl doesn’t work |
    • | samsung s5 | 6.0 | webgl works |
    • | Nexus 5 | 6.0 | webgl works|
    • | MotoX | 6.0 | webgl works |
    0 讨论(0)
  • 2020-12-21 12:21

    I suggest you try CrossWalk, based on Chromium/blink

    https://crosswalk-project.org/documentation/samples/webgl.html

    0 讨论(0)
  • 2020-12-21 12:25

    Well I wanted to add this as an edit, but it wasn't accepted, so I added my findings as an answer:

    I managed to make it work with CrossWalk on any device with Android 4+ on it and android webview with a sony xperia phone with android 5 on it. I wanted to add the things I've found:

    If you want to use android webview, your device must have android 5+ and your device must not be on gpu_blacklist. There is no device list for gpu_blacklist on the net that I can find, but there is a way to understand that your device is in the gpu_blacklist or not. Open chrome, then type chrome://gpu, then look at reset notification strategy field. If it is 0x8252 then your device supports webgl, if it is 0x0000 then your device is in the blacklist. So with android 5+ and your device not being on the gpu_blacklist, you can use webgl with android webview.

    If you want to use chrome instead of android webview even with a device which is on gpu_blacklist, you must use chrome version 37+. To check it, open chrome, type chrome://version. After that open chrome, type chrome://flags, in that page enable webgl and override software rendering list fields. With that you can use webgl even with devices that on the gpu_blacklist or with devices that has os below android 5 on them.

    If your device can't provide above requirements, like mine, you can use CrossWalk it works. However, the documentation is not well organized and you can't find much information other than its own documentation, in case you have problems with it. The reason CrossWalk works is when you build apk file you can send command line arguments like --ignore-gru-blacklist. However as the documentation states if you use this on devices that are on the gpu_blacklist, your application or the whole device might froze.

    0 讨论(0)
提交回复
热议问题