How to get device native screen resolution?

I’m changing my game resolution using Screen.SetResolution. Testing it in my Android device: Screen.height, Screen.currentResolution, Display.systemHeight and Display.renderingResolution return the resolution I set. I need the device native resolution instead.

Is there a way to get it? If not, can I assume that the initial value in Screen.currentResolution (before changing it) is the device native resolution in Android and iOS?

According to the docs entry for Screen.currentResolution, it will return the desktop’s resolution (which should be native) when the application is in windowed mode. From my own searches that appears to be the only way to do it.

https://docs.unity3d.com/ScriptReference/Screen-currentResolution.html

But Screen.currentResolution returns the resolution I set using Screen.SetResolution, not the device resolution

1 Like

Are you starting windowed?

I’m talking about mobile devices, not desktop.

You could give this a shot. Absolutely no idea if it works.

If you’re on android, you COULD attempt direct java call trough AndroidJNI

However, the syntax of those calls is really messy.