An experimental browser for Android that lets developers create Augmented Reality (AR) experiences using web technologies. An iOS version is also available.
Note: This is not an official Google product. Nor is it a fully-featured web browser. Nor are the enabling JavaScript APIs standards, or on the standardization path. WebARonARCore is only meant to enable developer experimentation.
WebARonARCore is still built on top of the Android ARCore Developer Preview 1 APK and because of that, only a certain number of devices are supported officially: Google Pixel 1 and 2 (both standard and XL) and Samsung Galaxy S8. The check to only detect these devices at runtime has been removed but the behavior on other ARCore models (supported by newer ARCore versions) is undefined.
Install the ARCore APK, either directly from a device:
...or by using ADB:
$ adb install -r path/to/arcore_preview.apk
Directly from a device:
...or by using ADB:
$ adb install -r /path/to/WebARonARCore.apk
Alternatively, the WebARonARCore APK can be built and installed from source.
A list of example scenes compatible with WebARonARCore and WebARonARKit are available at developers.google.com.
To build AR web experiences that work with WebARonARCore (or WebARonARKit for iOS), we recommend three.ar.js, a helper library that works with the popular three.js WebGL framework. Three.ar.js provides common AR building blocks, such as a visible reticle that draws on top of real world surfaces, and example scenes.
WebARonARCore uses WebViews, which is a similar debugging process to debugging Chrome for Android tabs. Check out the prereqs for your device at Get Started with Remote Debugging Android Devices, and learn more about Remote Debugging WebViews by opening chrome://inspect
in the desktop browser while your device is connected via USB.
WebARonARCore can optionally be built and installed from source. Instructions for cloning and building Chromium are available at chromium.org
Prerequisites:
We recommend the following steps:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:/path/to/depot_tools
chromium
and move to it: $ mkdir ~/chromium && cd ~/chromium
~/chromium$ fetch --nohooks android
. Note: This process may take a long time (an hour?)src
folder: $ cd src
.$ gclient sync
. Note: This process may take some time too.~/chromium/src$ build/install-build-deps-android.sh
~/chromium/src$ . build/android/envsetup.sh
git remote add github https://github.com/google-ar/WebARonARCore.git
git fetch github
git checkout --track github/webarcore_57.0.2987.5
~/chromium/src$ gclient sync --disable-syntax-validation
. Note: This process may take some time too.~/chromium/src$ mkdir -p out/build
.out/build/args.gn
. Copy and paste the following content in the args.gn
file:
target_os = "android"
target_cpu = "arm64"
is_debug = false
is_component_build = true
enable_webvr = true
proprietary_codecs = false
ffmpeg_branding = "Chromium"
enable_nacl = false
remove_webcore_debug_symbols = true
~/chromium/src$ gn args out/build
. Note: once the command is executed, the vi editor will show you the content of the args.gn
file just edited a few steps before. Just exit by pressing ESC and typing colon and x
.The line below not only compiles Chromium but also installs the final APK on to a connected device and runs it, so it is convenient that you to connect the device via USB before executing it. The project that will be built by default is the Chromium WebView project, the only one that has been modified to provide AR capabilities.
~/chromium/src$ ./build_install_run.sh
You can review the content of the script to see what it does (it is a fairly simple script) but if you would like to compile the final APK on your own you could do it by executing the following command:
~/chromium/src$ ninja -C out/build android_webview_apk
The final APK will be built in the folders ~/chromium/src/apk
and ~/chromium/src/out/build/apks
.
WebARonARCore is built of two essential technologies: ARCore and Chromium. We also extend the WebVR 1.1 API, which gives us much of what we need for augmented reality, with a few more essentials, such as motion tracking, rendering of the camera's video feed, and basic understanding of the real world. For details, see WebVR API extension for smartphone AR
Apache License Version 2.0 (see the LICENSE
file inside this repo).