Add a Splash Screen
The Meta Horizon platform allows splash screens that are driven by the operating system. System splash screens offer a high-performance, high-quality alternative to common implementations that are dependent upon the application layer, and load significantly faster than their application-driven counterparts.
In this topic, you’ll learn how to create your own system splash screen.
Creating a system splash screen
To add a system splash screen to your app, follow these steps:
- Name the PNG file you want to use for the splash screen
vr_splash.png
and place it under assets
in the application APK. - Add the following to the APK manifest:
<meta-data android:name="com.oculus.ossplash" android:value="true"/>
When you are finished, build and run your application.
During startup, the system splash screen appears with the standard Meta animated loading icon world-locked beneath it. Similar to the behavior of built-in Meta UI overlays, the splash screen and loading icon pop to center when the viewer looks too far in another direction.
The system splash and loading icon disappear upon the first app frame, whether that frame is an app-driven splash screen or a 3D scene, so they can both work together if you want animated app-driven splashes, but want to display a system splash beforehand to get something up as soon as possible.
To achieve optimal visual quality, the system splash screen is automatically re-sized and positioned according to the dimensions of the PNG source file. You can control the size by increasing or decreasing the resolution of your PNG file. For example, to double the size of the splash screen, double its dimensions. To quickly test different sizes to find what you like, you can use adb shell setprop debug.oculus.ossplash.ratio
to apply a float ratio multiplier to the splash screen’s dimensions. That is, setting debug.oculus.ossplash.ratio
to 2.3 would scale the system splash screen by 2.3x.