Screen Size +FullScreen

Started by PaniX, September 20, 2013, 07:12:44 PM

Previous topic - Next topic

PaniX

Two hopefully smaller questions, which aren't direct about JPCT-AE, but which may be helpful for others using the engine too.
1) How to get the screen size from the smartphone the user uses?
2) How to make the application full screen, without the status bar on the upper part of the screen?
Thanks!

EgonOlsen

There might be other ways, but at least the onSurfaceChanged()-method will be called with the current dimensions.

About the status bar, i'm doing:


requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(LayoutParams.FLAG_FULLSCREEN);

PaniX

Hm, I've also found the method adding
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
to the Manifest...
Is it a good way?

EgonOlsen

That's fine too. I prefer code over XML but that's just me.

PaniX

I don't like the XML that much, because it was confusing when I've started learning java on Android.