How to make fullscreen with code on android ? (for FullScreen Immersive Button not supported phones)

Hello everyone, I made a little platform 2D game and I bought some mistakes about it. I’m using version 4.18.3.
It is not active when I activate the “Fullscreen immersive” button. My phone is Vestel Venus V4 (android 7.0) and of course not on the supported phones list. ([if you want to check list click here][1])
I think I can fix it manually by writing code but I don’t know which files I need to organize.

- How do I change which java files in the project?

Thanks in advance for answers.

251784-bug-immersive.png

So there is another problem.
The problem is that I can not edit the splash screen.

251787-launch-problem.png

Hi, I had an activity I wanted to be fullscreen, I’ve put the following code in the activity onCreate method:

				getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);

You can do it in your game activity if don’t need another one.
As for the splash screen, check what image do you have in Build/Android/res folder, if it is wrong, then delete folder Build completely.

I tried what you said but when I launch to device, I checked the ue4 code and ue4 deletes the code. this location – >…\Intermediate\Android\APK\src\com\epicgames\ue4\GameActivity.java
I think I need to get the apk output android studio but it doesn’t make sense for me to do it again for every bug.

For the second problem, I did what you said and I checked. I need to write SplashScreen in java with SplashScreen.java file for the solution. I didn’t own my phone when I deleted and reloaded the Build file.

-Is there a way I can do the splash screen with a widget? It would be better for me.

You can’t modify those files directly since they are modified each time you build your game. You need to use a combination of ubt and apl. In your game.build.cs you need to add apl file like this:

        if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PrivateDependencyModuleNames.AddRange(new string[] { "Launch" });
            AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(ModuleDirectory, "YourName_APL.xml"));
        }

create an file with that name and apl extension and make it look like this:

<?xml version="1.0" encoding="utf-8"?>
<root xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.YourCompany.YourPackage">

	<init>
		<log text="APLr init"/>
	</init>
<gameActivityOnCreateAdditions>
     <insert>
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                 WindowManager.LayoutParams.FLAG_FULLSCREEN);
     </insert>
   </gameActivityOnCreateAdditions>

This way this code will be always inserted into GameActivity.java in OnCreate() method.

1 Like

I apologize for the late reply, I was ill.I created the project with blueprint. So I couldn’t find the build.cs file.I made an arrangement like the one pictured below, but I didn’t achieve it.

This is a modification to manifest file, but you need to modify GameActivity.java. I believe this can only be done using the source code.

There is a setting to force the app to go fullscreen. Search for the entry “Maximum supported aspect ratio” and set it to 2.4.