November 6, 2019 update:
  • There's a new open source Cardboard SDK that offers a streamlined API, improved device compatibility, and built-in viewer profile QR code scanning. We recommend that all developers actively building for Google Cardboard migrate to the new Cardboard SDK: iOS, Android NDK, Unity XR Plugin (SDK)
October 15, 2019 update:
  • The Daydream View VR headset is no longer available for purchase. However, you can continue to use the existing Google VR SDK to update and distribute your apps to the Google Play Store, and make them available to users in the Daydream app.

Quickstart for Google VR SDK for Android NDK

This document describes how to get started with Google VR for Android by building a sample C++ app using the NDK.

Most NDK developers have their own preferred way of building and deploying applications. This tutorial uses Android Studio, but you should feel free to follow along in the build environment of your choice.

We'll build the following sample app in this guide:

  • HelloVR, a sample app that works with any VR viewer and uses touch events to interact with the system.

Build the HelloVR sample app

First, read about HelloVR and how to build it using the SDK. The requirements and steps to build the app using the NDK are nearly the same, with the following key differences:

  • Download the latest version of the Android NDK.

  • Extract the NDK .so files by running:

     ./gradlew :extractNdk
  • In settings.gradle, uncomment the following line to enable that sample:

     include ':samples:ndk-hellovr'
  • Select samples-ndk-hellovr as your target.