Configure your Android VR app’s manifest with the necessary VR settings for development as shown in the following manifest segment.
Note: These manifest requirements are intended for development and differ from our submission requirements. Before submitting your application, please be sure to follow the manifest requirements described at Application Manifests for Release Builds in the Distribute section.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="<packagename>" android:versionCode="1" android:versionName="1.0" android:installLocation="auto"> <application> <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/> <meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2"/> <activity android:screenOrientation="landscape" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:configChanges="density|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode" android:launchMode="singleTask" android:resizeableActivity="false"> </activity> </application> <uses-sdk android:minSdkVersion="21"/> <uses-feature android:glEsVersion="0x00030001" /> </manifest>
vr_onlymeta data tag should be added for VR mode detection.
configChangesare as follows:
android:configChanges="density|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode". Note that the density config change is only required when targeting API level 24 or greater.
android:resizeableActivityis only required when targeting API level 24 or greater.
minSdkVersionis set to API level 21. This ensures that the app will run on all supported mobile devices.
noHistoryattribute to your manifest.
<uses-feature android:name="android.hardware.vr.headtracking" android:required="true" android:version="1" />is required for v2 signing, which is required for store review for Oculus Quest apps.
targetSdkVersionmust be set appropriately in the
build.gradlefile. API versions greater than the minimums specified prevent users from installing your app. For previously released apps, use caution when changing the
minSdkVersionas you may break compatibility for users on older versions of Android. In Android Studio, these values can be set from the Properties and Default Config sections at File > Project Structure > Modules.
The following table contains the accepted values for
targetSdkVersion. Setting the optional
compileSdkVersion ensures you receive up-to-date compiler error messages.
| Device | minSdkVersion | targetSdkVersion | compileSdkVersion (optional)| |--------|---------------|------------------|-------------------| | Quest | 23-29 | 25+ | 29 | | Quest 2 | 23-29 | 25+ | 29 |
Applications submission requirements may require additional adjustments to the manifest. Please refer to Application Manifests for Release Versions in our Publishing Guide.
An app is assumed to target Quest unless you include an Android manifest entry that indicates it also supports Quest 2. As a result, the Oculus mobile runtime defaults to reporting the current device is a Quest and maximizes compatibility by modifying internal behavior as needed to best run on Quest devices.
When you create apps that target Quest and Quest 2, you can check device capabilities before using them, or use an Oculus runtime method to detect the device that app is running on. You can then enable extra features to improve the user experience for apps running on Quest 2. For example, you can add more objects to a scene on Quest 2, to take advantage of its faster GPU.
To indicate an application supports Quest 2, the following entry should be added to the Android manifest:
<meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2"/>
If this manifest entry isn’t present, regardless of SDK headers or other factors, the runtime will respond with Quest as the current device type.
Remember that although checking the device type has valid use cases, you should always use capability-based checking where you can.
For example, to check if a supports 6DOF, you should query for
VRAPI_SYS_PROP_HAS_POSITION_TRACKING instead of relying on generic device type checks.
The only valid way to get device model information is through the Oculus APIs.
Native C++ developers can query the device type by using the
GetSystemPropertyInt method. For example:
ovrDeviceType deviceType = vrapi_GetSystemPropertyInt(&java, VRAPI_SYS_PROP_DEVICE_TYPE);
You should not use the Android Java API a
ndroid.os.build.MODEL for checking the type of device type. This is not supported, and will always return Oculus Quest.