This site has been archived and remains strictly as a historical reference for developers who actively maintain apps built using the legacy Google VR SDK, which was last updated in 2019 and is no longer receiving updates.
  • All developers actively developing experiences for Google Cardboard should use the new open source Cardboard SDKs for iOS, Android NDK, and Unity XR Plugin. These new SDKs offer streamlined APIs, improved device compatibility, and built-in viewer profile QR code scanning.
  • The Daydream View VR headset is no longer available for purchase as of October 15, 2019. Existing apps on supported devices are unaffected for users who previously installed those applications. It is no longer possible to opt-in to Daydream distribution via Google Play.

Getting started with 6DoF controllers in the Android NDK

Stay organized with collections Save and categorize content based on your preferences.

This guide shows you how to set up Google VR development with the Android NDK and build the HelloVRBeta sample app. This app is designed to help you learn about working with the see-through mode technology as well as the experimental 6DoF controllers and faceplate.

  1. Download and install the latest version of gvr-android-sdk\*.zip from the releases page.
  2. Follow these steps to build and run the HelloVRBeta sample app. The requirements and steps to build the sample app using the NDK are nearly the same as building the HelloVR sample app for the SDK, with the following key changes:

    1. Download the latest version of the Android NDK.
    2. Extract the NDK .so files by running:

        ./gradlew :extractNdk
      
    3. In settings.gradle, uncomment the following line:

        include ':samples:ndk-hellovrbeta'
      
    4. To build and run the sample app in Android Studio, select samples-ndk-hellovrbeta as your target.

If you're familiar with developing for Daydream, here are the changes you need to make in order to support the 6DoF controllers and faceplate:

  • To identify your app as supporting the 6DoF controllers and faceplate, add the following meta-data tag to your AndroidManifest.xml file within the <activity> element:

    <activity …
    
      <meta-data android:name="com.google.vr.controllers.supportedConfigs" 
      android:value="3Dof|2x6Dof"/>
    
    </activty>
    
  • Make sure your gvr_controller_create_and_init() call specifies GVR_CONTROLLER_ENABLE_POSITION; otherwise, the position data will be discarded.

Using the controllers after setup

Fluorescent lighting and HTC Vive Lighthouses are both known to interfere with tracking. Turn off the Vive Lighthouse if you have one, or move to a room with different conditions.