How to make the game REALLY full screen? -ANDROID

megagewinnspiel

  • Posts: 396
Hey guys, you all probably know these mobile games, where there is NO task bar at the bottom. Normaly you have this little bar with a few buttons, like "Back", "Home" and "Menu", but how can I cut that bar out? Most modern games already have this feature and use 100% of the screen.

Thanks :)

sdieters

  • Posts: 2068
Go to game settings > mobile > scale option > stretch to fit
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

megagewinnspiel

  • Posts: 396
I already use this awesome feature, but this does not make the bar go away, it just fills out everything else perfectly..... just not the Bar :D.

sdieters

  • Posts: 2068
Can you post a screen shot of that bar? Im not sure i know what you are talking about then
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

megagewinnspiel

  • Posts: 396
I will do my best to show it to you :)
If you start the game "Arcane Soul", wich I will use as an example here, it will look like this:

You can tap on the screen, play the game and do pretty much everything without the bar to ever pop up until you swipe either over the top or the right side of the screen. Then this happens:


Now you can exit the game by going into the task manager, tapping the back or the menu button.
THIS is the bar I am talking about :)


letmethink

  • *
  • Posts: 2547
I made a post about this a while ago. I hadn't tested it but I had a feeling it would work. Here is what I thought you would need to do:

Quote
From what I have read, if you change the base GameActivity.java file to include the lines below then it will work. Has anyone tried this (btw, my MainActivity.java file was found at: C:\Program Files\Stencyl\plaf\haxe\lib\openfl-native\1,1,4\templates\android\template\src\org\haxe\nme ). I am asking this because on the computer I use for Stencyl I don't have administrator privaleges and I want to check it works before having to request it be added.
Code: [Select]
private void setSystemUiVisibility() {
    ::if WIN_FULLSCREEN::
    ::if (ANDROID_TARGET_SDK_VERSION >= 19)::
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        getWindow().getDecorView().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
        );
    }
    ::elseif (ANDROID_TARGET_SDK_VERSION >= 16)::
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
            View.SYSTEM_UI_FLAG_LOW_PROFILE |
            View.SYSTEM_UI_FLAG_FULLSCREEN
        );
    }
    ::end::
    ::end::
}

private final Runnable activateImmersiveMode = new Runnable() {
    @Override
    public void run() {
        setSystemUiVisibility();
    }
};

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
        mHandler.postDelayed(activateImmersiveMode, 500);
    }
    return super.onKeyDown(keyCode, event);
}

@Override protected void onResume() {
    super.onResume();
    setSystemUiVisibility();
    // rest of onResume()
}

@Override protected void onStart() {
    super.onStart();
    setSystemUiVisibility();
    // rest of onStart()
}


~Letmethink

mvmsaikrishna

  • Posts: 83
Thank you I think that should do the work :) .  I'm thinking of writing an extension but this could be  better. Will let you know if this works in the morning.

mvmsaikrishna

  • Posts: 83
I tried this.  Not working.  Strange thing is, even after adding the above to GameActivity.java, when the game is compiled, in the GameAcitivity.java in the 'Export' folder of the game - the code is modified to fit Jellybean version only.

ps: I have android-4.4 sdk manually placed in android-sdk folder of stencyl's

letmethink

  • *
  • Posts: 2547
Did you modify the root GameActivity.java. This one is copied every time a game is compiled. Not sure if you read correctly, but mine was found at: C:\Program Files\Stencyl\plaf\haxe\lib\openfl-native\1,1,4\templates\android\template\src\org\haxe\nme
~Letmethink

mvmsaikrishna

  • Posts: 83
Yeah thats what I meant. Even after changing the root GameActivity.java , the one that is created in Export folder of the game, has a modified code.

letmethink

  • *
  • Posts: 2547
Hmm. That sounds weird. I'll search my hard drive and see where else it appears. Maybe there's a root per user MainActivity.java file
~Letmethink

mvmsaikrishna

  • Posts: 83
I tried it on os x mavericks and ubuntu. same problem.

letmethink

  • *
  • Posts: 2547
For me there seems to be another MainActivity.java file here:

C:\Users\username\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\samples\android-19\legacy\ApiDemos\src\com\example\android\apis\view

Not sure whether this would have anything to do with it.

There's also one here:

C:\Users\username\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\samples\android-19\legacy\TicTacToeLib\src\com\example\android\tictactoe\library

But that seems to be it for my system other than the generated games.

~Letmethink

mvmsaikrishna

  • Posts: 83
No that's not related. It works like this, i think:

1. The core GameActivity.java is in stencyl's folders.
2. It writes that file to the current game which is being 'RUN'.