The Mobile 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
.
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 Oculus Mobile SDK must not contain spaces in its path. If you have placed your Oculus Mobile 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
:
NativeActivity
class to illustrate the use of the different layer types available with vrapi_SubmitFrame2
.MULTI_THREADED
define encapsulates the code that shows how the VrApi can be integrated into an engine with a separate renderer thread.NativeActivity
class to avoid manually handling all lifecycle events. This sample does not use the application framework, onlyVrAPI. It provides a good example of how to integrate the VrApi in an existing engine that uses NativeActivity
. The MULTI_THREADED
define encapsulates the code that shows how the VrApi can be integrated into an engine with a separate renderer thread.Information about how to build apps in Android Studio can be found on the Android Studio Basics page.
Use one of the following methods to install the sample media on your mobile device.
installtophone.bat
from your Oculus Mobile SDK directory (e.g., C:\Dev\Oculus\Mobile\installToPhone.bat
).C:\Dev\Oculus\Mobile\
).adb push sdcard\_SDK /sdcard/
C:\Dev\Oculus\Mobile\sdcard\_SDK\oculus\
) to the mobile device location (e.g., \MobileDevice\Phone\Oculus\
).