Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Kiosk mode for oculus go

JonnyboybabyJonnyboybaby Posts: 6
NerveGear
edited September 2018 in Mobile Development
Might have posted this in the wrong place, so Mods feel free to delete my post

Hello, I am trying to follow this post https://forums.oculusvr.com/developer/discussion/66953/solution-for-kiosk-mode-on-oculus-go but I can't wrap my head around some things. I have a manifest and a java script overriding the onCreate and onStop methods (I think). I haven't been able to make the simple singleton AndroidDaemonService and I don't know how to adjust the manifest to include the AndroidDaemonService.

Any help is greatly appreciated

KioskMode.java:
package com.oculus.UnitySample;
import com.unity3d.player.UnityPlayerActivity;
import android.os.Bundle;
import android.util.Log;
public class KioskMode extends UnityPlayerActivity {
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
        super.onCreate(savedInstanceState, persistentState);
        Intent mServiceIntent = new Intent(this, AndroidDaemonService.class);
        this.startService(mServiceIntent);
    }

    @Override
    protected void onStop() {
        super.onStop();
        Context context = AndroidDaemonService.instance;
        Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
        launchIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        context.startActivity(launchIntent);
    }
}

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.oculus.UnitySample" android:versionCode="1" android:versionName="0.1" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application android:icon="@mipmap/app_icon" android:label="@string/app_name" android:theme="@style/UnityThemeSelector" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner">;
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="landscape" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only" />
<meta-data android:name="unity.build-id" android:value="89a5995f-9c55-4ed0-a888-a29bf3440b49" />
<meta-data android:name="unity.splash-mode" android:value="0" />
<meta-data android:name="unity.splash-enable" android:value="False" />
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>

Comments

  • thierrypulthierrypul Posts: 7
    NerveGear
    This article has some info about kiosk mode for Oculus Go: https://headjack.io/blog/the-ultimate-vr-kiosk-mode-guide/

    Although for you the section on the Pico headset might be more interesting, since that one requires some modifications to the AndroidManifest as well, which is probably similar for an Oculus Go app, since they are both running on Android.
Sign In or Register to comment.