Hiding navigation buttons on Android

Hi.

Is there a way to access the immersive mode on android from either blueprints or c++? Just to clarify, immersive mode was added in Kitkat(4.4) and is pretty much just hiding the navigation buttons and top panel on android.

Currently immersive mode isn’t supported, but it isn’t too hard to add. Supporting it requires an addition to GameActivity.java in Engine/Build/Android/Java/src/com/epicgames/ue4:

	@Override
	public void onResume()
	{
		super.onResume();
		
		// only do this on KitKat and above
		if (android.os.Build.VERSION.SDK_INT >= 19)
		{ 
			View decorView = getWindow().getDecorView(); 
			decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); 
		}
		
	}

Thanks for the help!

In 4.8 GameActivity.java already have this lines, but navigation buttons still on screen.

First, IMMERSIVE_STICKY only works on KitKat and higher. Second, you need to turn on the “Enable Fullscreen Immersive on KitKat and above devices” checkbox in the Android project settings. Lastly, there was a typo in UEDeployAndroid.cs:

            Text.AppendLine(string.Format("\t\t<meta-data android:name=\"com.epicgames.ue4.GameActivity.bShouldHideUI=\" android:value=\"{0}\"/>", EnableFullScreen ? "true" : "false"));

should have been:

            Text.AppendLine(string.Format("\t\t<meta-data android:name=\"com.epicgames.ue4.GameActivity.bShouldHideUI\" android:value=\"{0}\"/>", EnableFullScreen ? "true" : "false"));

The = should be removed.

Thanks

I don’t find the “Enable Fullscreen Immersive on KitKat and above devices” option. where it is?

I looks like the project setting (in the Android section) was enabled for 4.8. This will be in 4.9, or you can get it from GitHub master branch here:

https://github.com/EpicGames/UnrealEngine/commit/38247c4430fd1c41f278083259d06ae4984695f1

thanks for the help
by intertainment