Locking the game to fullscreen and landscape orientation
As with the Sub Hunter project, we want to use every pixel that the player's Android device has to offer, so we will make changes to the AndroidManifest.xml
file that allow us to use a style for our app that hides all the default menus and titles from the user interface.
Make sure the AndroidManifest.xml
file is open in the editor window.
In the AndroidManifest.xml
file, locate the following line of code:
android:name=".PongActivity">
Place the cursor before the closing >
shown previously. Tap the Enter key a couple of times to move the >
a couple of lines below the rest of the line shown previously.
Immediately below ".PongActivity"
but before the newly positioned >
, type or copy and paste this next line of code to make the game run without any user interface.
Note that the line of code is shown on two lines because it is too long to fit on a printed page, but in Android...