2

I have developed an android application for playing 360 videos in gear VR device.I have used the below code inside manifest for preventing the gear VR app from auto-launching.(Previously,when i connected the phone with the gear VR device,gear VR app launches instead of my app.And i can't get in to my app)

<meta-data
    android:name="com.samsung.android.vr.application.mode"
    android:value="vr_only"/>

But when i used this code i can't open the app outside of gear VR device.That means when i click the app icon,the splash screen appears and a popup comes.."to open This application, insert the device into Gear VR".So i changed the manifest as:-

<meta-data
    android:name="com.samsung.android.vr.application.mode"
    android:value="vr_dual"/>

Now the problem is gear VR app again launches by default when i connected to gear VR device.How to handle this.? Can someone help me to find a solution....

max
  • 263
  • 2
  • 16
  • did you find a way to solve this problem? Where did you find the other application modes (such as vr_dual)? – fogx Aug 22 '17 at 08:31

1 Answers1

0

Try "dual" instead

<meta-data
android:name="com.samsung.android.vr.application.mode"
android:value="dual"/>

By the way, you can find the value in the source code VrActivity.java

public static boolean isHybridApp( final Activity act ) {
    try {
        ApplicationInfo appInfo = act.getPackageManager().getApplicationInfo(act.getPackageName(), PackageManager.GET_META_DATA);
        Bundle bundle = appInfo.metaData;
        String applicationMode = bundle.getString("com.samsung.android.vr.application.mode");
        return (applicationMode.equals("dual"));
    } catch( NameNotFoundException e ) {
        e.printStackTrace();
    } catch( NullPointerException e ) {
        Log.e(TAG, "Failed to load meta-data, NullPointer: " + e.getMessage());         
    } 

    return false;
}
Ji Fang
  • 3,288
  • 1
  • 21
  • 18