Native Samples

Important

All Oculus Quest developers MUST PASS the concept review prior to gaining publishing access to the Quest Store and additional resources. Submit a concept document for review as early in your Quest application development cycle as possible. For additional information and context, please see Submitting Your App to the Oculus Quest Store.


We're no longer accepting submission of 32-bit Oculus Quest apps. Any new or updated Oculus Quest application needs to be 64-bit. Please contact Oculus if you are unable to comply with this policy. Oculus Go and Gear VR apps will not be affected by this change.

The Native SDK includes a set of sample projects that prove out virtual reality application development on the Android platform and demonstrate high-performance virtual reality experiences on mobile devices. The native sample projects can be found in the Mobile SDK at \ovr_sdk_mobile\VrSamples.

Sample Applications and Media

The sample projects included with the SDK are provided as a convenience for development purposes. Some of these projects are similar to apps available for download from the Oculus Store. Due to the potential for conflict with these versions, we do not recommend running these sample apps on the same device on which you have installed your retail experience.

Note: Due to limitations of Android ndk-build, your Native SDK must not contain spaces in its path. If you have placed your Native SDK in a path or folder name that contains spaces, you must move or rename the folder before you build our samples.

The following samples can be found in \VrSamples\:

  • Oculus 360 Photos: A viewer for panoramic stills.
  • Oculus 360 Videos: A viewer for panoramic videos.
  • Oculus Cinema: Plays 2D and 3D movies in a virtual movie theater.
  • VrController: A simple scene illustrating use of the VrApi Input API.
  • VR Compositor_NativeActivity: A simple scene using the Android NativeActivity class to illustrate the use of the different layer types available with vrapi_SubmitFrame2.
  • VR Cube World samples: A simple scene with colorful cubes illustrating construction of basic native apps using different tools provided by the SDK. There are three versions of VR Cube World:
    • VrCubeWorld_SurfaceView is closest to the metal. This sample uses a plain Android SurfaceView and handles all Android Activity and Android Surface lifecycle events in native code. This sample does not use the application framework - it only uses the VrApi. It provides a good example of how to integrate the VrApi in an existing engine. The MULTI_THREADED define encapsulates the code that shows how the VrApi can be integrated into an engine with a separate renderer thread.
    • VrCubeWorld_NativeActivity uses the Android NativeActivity class to avoid manually handling all the lifecycle events. This sample does not use the application framework - it only uses the VrAPI. It provides a good example of how to integrate the VrApi in an existing engine that uses a NativeActivity. The MULTI_THREADED define encapsulates the code that shows how the VrApi can be integrated into an engine with a separate renderer thread.
    • VrCubeWorld_Vulkan uses the Android NativeActivity class similar to VrCubeWorld_NativeActivity. The difference is that it provides an example of how to integrate the VrApi into an existing Vulkan-based engine. This sample includes examples of Vulkan Fixed Foveated Rendering (FFR), multi-view, and MSAA usage.

How to Build A Sample App

Information about how to build apps in Android Studio can be found on the Android Studio Basics page.

How to Install Sample Media

Use one of the following methods to install the sample media on your mobile device.

  1. Use the supplied script.
    • Connect to the device via USB.
    • Ensure you have permissions to transfer files to the device.
    • Run installtophone.bat from your Native SDK directory e.g., C:\Dev\Oculus\Mobile\installToPhone.bat}.
  2. Use Windows Explorer.
    • Connect to the device via USB.
    • Ensure you have permissions to transfer files to the device.
    • Open a Windows Explorer window and transfer the contents of the sample media folder, e.g., C:\Dev\Oculus\Mobile\sdcard\_SDK\oculus\ to the mobile device location e.g., \MobileDevice\Phone\Oculus\.