Reader small image

You're reading from  Learning Java by Building Android Games - Third Edition

Product typeBook
Published inMar 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781800565869
Edition3rd Edition
Languages
Right arrow
Author (1)
John Horton
John Horton
author image
John Horton

John Horton is a programming and gaming enthusiast based in the UK. He has a passion for writing apps, games, books, and blog articles. He is the founder of Game Code School.
Read more about John Horton

Right arrow

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...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Java by Building Android Games - Third Edition
Published in: Mar 2021Publisher: PacktISBN-13: 9781800565869

Author (1)

author image
John Horton

John Horton is a programming and gaming enthusiast based in the UK. He has a passion for writing apps, games, books, and blog articles. He is the founder of Game Code School.
Read more about John Horton