AndroidDeviceProfileSelector plugin is initialized after window created already.

Hey guys.

I found a bug about screen resolution on android device.

As you know, you need to configure “r.MobileContentScaleFactor” in DefaultDeviceProfiles.ini when you want to change resolution scale.
Setting Device Profiles | Unreal Engine Documentation explains it. (very simply… anyway)

I’ve tried to set ACTUAL resolution of device. (1:1 pixel scale) and I found following code in AndroidWindow.cpp

	// CSF is a multiplier to 1280x720
	static IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.MobileContentScaleFactor")); 
	float RequestedContentScaleFactor = CVar->GetFloat();

	// 0 means to use native size
	int32 Width, Height;
	if (RequestedContentScaleFactor == 0.0f)
		Width = MaxWidth;
		Height = MaxHeight;
		UE_LOG(LogAndroid, Log, TEXT("Setting Width=%d and Height=%d (requested scale = 0 = auto)"), Width, Height);

So, I set it in DefaultDeviceProfiles.ini

[Android DeviceProfile]


so, I followed the log using logcat and found wrong sequence of initializing. (my device’s resolution is 1920x1200)

This is wrong, right?

I’ve solved this problem to set r.MobileContentScaleFactor value to DefaultEngine.ini. (DefaultEnging.ini is read before calling FAndroidWindow::GetScreenRect())
but I know this is weird solution.

is there any solution except modifying DefaultEngine.ini?

Hi dochigun,

I admit you’ve exceeded my modest Android knowledge. If no one else pipes up today with why this might not be a bug, then please feel free to post to AnswerHub as a bug report. Here is a post with guidelines for what information we’d really appreciate it if you can include, if applicable to your specific issue, and we’ll see what we can do about it. Thanks very much!