EloiStree / CodeAndQuestsEveryDay

Regular research on the Quest for developers.
http://codeandquests.page.link/discord
32 stars 4 forks source link

Code Question: What should I do with the Android Manifest for the Quest ? #376

Open EloiStree opened 5 years ago

EloiStree commented 5 years ago

How to set android manifest for Quest

Ok so before the 20 June 2019 you did not need to touch to the Android Manifest to build on the Quest. But Oculus Team did a change on it. So you need to use it if you want the Quest to behave like it and not like a Go.

So what I did based on friend an reddit post.

  1. Create Folder Plugins/Android in Assets root
  2. Copy this code in the a AndroidManifest.xml file
    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="auto">
    <uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
    <!-- Request the headset DoF mode -->
    <application
      android:allowBackup="false">
    <activity
        android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
        android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
        android:launchMode="singleTask"
        android:name="com.unity3d.player.UnityPlayerActivity"
        android:label="@String/app_name"
        android:excludeFromRecents="true">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.INFO"/>
      </intent-filter>
    </activity>
    <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" />
    </application>
    </manifest>
  3. And build.

Source

image image

EloiStree commented 5 years ago

image https://www.reddit.com/r/oculus/comments/cjarm3/unity_development_on_oculus_quest_only_one/evcanvy/

EloiStree commented 5 years ago

Disto

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="auto">
    <uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" /><!-- Request the headset DoF mode -->
    <application
        android:allowBackup="false">
        <activity
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
            android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
            android:launchMode="singleTask"
            android:name="com.unity3d.player.UnityPlayerActivity"
            android:label="@String/app_name"
            android:excludeFromRecents="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.INFO"/>
            </intent-filter>
        </activity>
        <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
        <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" />
    </application>
</manifest>

Plus:

<intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.INFO"/>
            </intent-filter>
        </activity>
        <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
        <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" />
EloiStree commented 5 years ago

Edit the manifrest

image https://answers.unity.com/questions/536095/how-to-write-an-androidmanifestxml-combining-diffe.html

EloiStree commented 5 years ago

Classic edit manifest

Default Alt
https://youtu.be/G4-bPjhe2A4