Getting started with the Snake game
To get started, make a new project called Snake with the usual settings (empty Activity, no layout file, without backward compatibility) and call the Activity SnakeActivity.
Make full screen and landscape
As we have done in all the previous projects, let's make the game full screen and locked to landscape orientation.
As a reminder, here is how to edit the AndroidManifest.xml file:
- Open the
AndroidManifest.xmlfile in the editor window. - In the
AndroidManifest.xmlfile, locate the following line of code:android:name=".SnakeActivity"> - Place the cursor before the closing
>shown above. Tap the Enter key a couple of times to move the>a couple of lines below the rest of the line shown above. - Immediately below
SnakeActivitybut before the newly positioned>type or copy and paste these two lines to make the game run full screen and lock it in the landscape orientation.android:theme="@android:style/Theme.NoTitleBar.Fullscreen"...