VR Android Manifest

Your VR application's AndroidManifest.xml file contains several attributes that affect how it works in the Daydream and Cardboard platforms.

VR Activity attributes

To make your Activity compatible with Daydream, you must declare some attributes in the manifest file:

<activity
    android:name=".MyActivity"
    android:enableVrMode="@string/gvr_vr_mode_component"
    android:theme="@style/VrActivityTheme"
    android:resizeableActivity="false"
    ...>

The android:enableVrMode attribute enables Android VR Mode, a feature introduced in Android 7.0 (Nougat) to allow high-performance mobile VR applications. This attribute indicates to the system that it should enable VR mode automatically when your Activity launches.

The android:theme attribute above ensures that your Activity will look and behave correctly during VR transitions, and setting android:resizeableActivity to false indicates that your Activity can't be resized to share the screen with another Activity.

Platform compatibility

Each of your Activities must declare which VR platforms it supports (Daydream and/or Cardboard). You can do this by adding the DAYDREAM and/or CARDBOARD categories in the Activity's intent-filters section. For example, if your Activity only suppors Daydream but not Cardboard, you would declare it as follows:

<!-- Example of a Daydream-only Activity -->
<activity ... >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <!-- This marks the Activity as a Daydream Activity and allows it
             to be launched from the Daydream Home. -->
        <category android:name="com.google.intent.category.DAYDREAM" />

        <!-- This allows this Activity to be launched from the traditional
             Android 2D launcher as well. Remove it if you do not want
             this Activity to be launched directly from the 2D launcher. -->
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

If your Activity supports both Daydream and the Cardboard platforms, you should also declare the CARDBOARD category:

<!-- Example of a Daydream/Cardboard Activity -->
<activity ... >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <!-- This marks the Activity as a Daydream Activity and allows it
             to be launched from the Daydream Home. -->
        <category android:name="com.google.intent.category.DAYDREAM" />

        <!-- This marks the Activity as a Cardboard Activity and allows it
             to be launched from the Cardboard app. -->
        <category android:name="com.google.intent.category.CARDBOARD" />

        <!-- This allows this Activity to be launched from the traditional
             Android 2D launcher as well. Remove it if you do not want
             this Activity to be launched directly from the 2D launcher. -->
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

Lastly, if your Activity only supports Cardboard, you should declare the CARDBOARD category but not the DAYDREAM category:

<!-- Example of a Cardboard-only Activity -->
<activity ... >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <!-- This marks the Activity as a Cardboard Activity and allows it
             to be launched from the Cardboard app. -->
        <category android:name="com.google.intent.category.CARDBOARD" />

        <!-- This allows this Activity to be launched from the traditional
             Android 2D launcher as well. Remove it if you do not want
             this Activity to be launched directly from the 2D launcher. -->
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>