It should work even with an untrusted certificate if you proceed. The important thing is that you should have a certificate, of course we are speaking about a development environment 1. However the crucial part: you must use Chrome Canary for Android, see later.
Get Certificate
The easiest way
Use glitch, which is an online full-stack IDE (yep, with node and sqlite, made by the stackoverflow people) which will provide you a trusted subdomain.
Still easy and locally working way.
Creating certificate and corresponding certificate authority (CA)
you should use minica CA tool:
Install minica
(You must install and setup a GO
and gotools
first)
go get github.com/jsha/minica
Run this simple command, you should use you LAN IP instead of localhost, though.
minica --domains localhost
which creates the following files in your working directory
minica-key.pem
The private key of your new CA
minica.pem
The root certificate of your CA
localhost/cert.pem
The certificate of your website
localhost/key.pem
The private key to sign of your website certificate.
If you do not know what are these concepts, I recommend this friendly introduction.
Serve your site with your certificate.
You can use the http-server npm package, which is easy to use and can serve certificates
http-server -a 0.0.0.0 -p 8080 -S -C localhost/cert.pem -K localhost/key.pem
then access your site like https://192.168.1.42
or whatever is your LAN IP address.
Google play has it.
Setup Chrome Canary flags
Type chrome://flags
in your Chrome Canary's URL bar and enable the following flags: #enable-webvr
and #enable-gamepad-extensions
called WebVR and Gamepad extensions respectively.
Now your are good to go. 2
Notes:
If you plan to deploy your app in production you should acquire a globally trusted certificate from a CA. Let's Encrypt is free and easy automate and backed by the Linux Foundation, and sponsored by many big players.
WebVR on Android Chrome is still unstable and will be changed, so what I wrote will be deprecated soon.