06-25-2018 04:50 AM
<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>
After that, you need to execute this command via adb.adb shell cmd package set-home-activity <your package name>/<your activity name>
You can find your package name and your activity name in manifest file. After reboot device will start your app!AndroidDaemonService is simple service that has static singleton field. You have to write it by yourself.public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
super.onCreate(savedInstanceState, persistentState);
Intent mServiceIntent = new Intent(this, AndroidDaemonService.class);
this.startService(mServiceIntent);
}
So after you press home button, device will try to load Oculus home and immediately return to your application. For a user it will look like a white flash. So it's not a perfect solution, but at least it works.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);
}
06-26-2018 07:21 AM
06-29-2018 12:19 PM
06-29-2018 01:45 PM
06-29-2018 09:20 PM
mskdhitest1 said:
Thanks for posting! I just started working with the Oculus Go and I've been trying this solution with my Unity app but when i run
adb shell cmd package set-home-activity <your package name>/<your activity name>
I get the following error:
java.lang.IllegalArgumentException: Component ComponentInfo{<my package name>/<my activity>} cannot be home on user 0
Any suggestions?
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:label="@string/app_name">
<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" />
</activity>
If you use Unity, check if manifest placed correctly in Plugins/Android/AndroidManifest.xml. You can double check that via exctracting .apk or using something like apktool.
07-02-2018 11:12 AM
07-11-2018 02:25 AM
07-12-2018 03:09 AM
undef_dev said:
We have a KioskMode like Android launcher for download here: http://oculusgokioskmode.undef.ch/ The key feature is a custom overlay (.jpg image file) to hide and override the default "Enter VR" welcome screen.
07-13-2018 08:39 AM
07-17-2018 04:34 AM
maybe a dumb question - but how can I add this to the manifest?