Quickstart for Google VR SDK for Android NDK

  • This guide explains how to build a sample VR app for Android using the NDK and Android Studio.

  • Developers can adapt the instructions to their preferred build environment if needed.

  • The sample app, HelloVR, is designed to work with any VR viewer and utilizes touch interactions.

  • Before starting with the NDK build, familiarize yourself with the HelloVR app and its SDK-based build process outlined in the linked documentation.

  • Key differences for NDK builds include downloading the Android NDK, extracting .so files with a Gradle command, and enabling the 'ndk-hellovr' sample in the settings file.

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.