An Android application for Gear VR using Samsung S6 and S7.
Following implementation is for auto launch on mobile insertion to VR.
AndroidManifest.xml
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme"
android:launchMode="singleTask"
android:excludeFromRecents="true"
android:configChanges="orientation|keyboardHidden|screenSize"
android:clearTaskOnLaunch="true"
android:screenOrientation="landscape"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.INFO" />
</intent-filter>
<intent-filter> <action android:name="android.intent.action.proximity_sensor" /> </intent-filter>
<intent-filter> <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> </intent-filter>
<intent-filter> <action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" /> </intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/device_filter" />
</activity>
device_filter.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-device vendor-id="04e8" product-id="07d2" />
</resources>
It works but there is problem with Oculus app, sometime my app launch before Oculus app and other time Oculus app appear but my app doesn't launch.
Sometime when our app is open before mounting to VR Oculus app crash saying "Unfortunately, Oculus Home has stopped." due to conflict and system shows dialog.