The Forgotten Planet Game Music

The Forgotten Planet - Menu Music - By Josef Falkensköld ( www.falconshield.com )


Tuesday 19 April 2011

SDL Android Port Configure Menu removal when app starts.

Hello again!

While working on the game for Android I realized that the config menu that pops up when you boot the application is annoying since the user have to scroll down on the menu and press the "ok" button in order to get in-game.

I went in to the java code and disabled it.

Here's how you can do it too:

How to disable the startup config  menu:

1. Open up MainActivity.java


Find these two lines and comment them just like I've done here

        //_layout2.addView(_btn);

        //_layout.addView(_layout2);

Save & close file.

2. Open up Settings.java

Insert these two lines above the builder.setSingleChoiceItems section.

        Save(p);
        p.startDownloader();


Now comment the whole builder section:

/*builder.setSingleChoiceItems(items.toArray(new CharSequence[0]), MainMenuLastSelected, new DialogInterface.OnClickListener()
.
.
.
.

    if( item == selected )
    {
        Save(p);
        p.startDownloader();
    }
  }
});*/

Find the "alert.show();" line just under the builderSingeChoiceItems section and comment it:

//alert.show();

Save and close file.

3. (Optional) Open up globals.java and hardcode the values you want for the device like:

public static boolean AppUsesMouse = true;  //false;

etc.

Also remember that you can set these values in your AndroidAppSettings.cfg file.

I hardcoded the values too to be on the safe side, in case I forgot to add a value in the .cfg file.

Now your ready to build and run your application without the config menu.

Until next post!

SolarStrings

No comments:

Post a Comment