Learning Android Game Development
上QQ阅读APP看书,第一时间看更新

Project Structure of an Android Project

Click on the small arrow on the left-hand side of each folder to expand its view:

Various folders inside the project folder

As you can see, we have multiple folders in our project folder. Our main project folder contains three subfolders, which are manifest, java, and res; we will explore each of these folders individually now:

  • manifest: This folder contains your AndroidManifest.xml file, which is responsible for giving permissions to your app, as we learned in the preceding chapter.

  • java: This folder contains all your .java files, which are your Java code files. Generally, this folder has multiple subfolders that have your package name at the top, and within them, are source code files. You can observe in the preceding screenshot that we have our java folder, and we have a folder named nikhil.nikmlnkr.game within that, which is actually the package name of our game, and we have our FullScreenActivity within that. 

  • res: This folder contains all your resources. res here simply means resources that can include anything from simple string data to images to complex XML layouts. Simple terms, most of the things you see on the screen are stored here. You can design your front-end with the help of resources that you keep in the res folder.

Now that we know what these folders are, let's start designing our first program. Also, to stay true to our programming background, let's start with the famous Hello World example. Things are going to get really interesting from this point on. By now, you have grasped pretty much all the basics you need to start development. Now, in a matter of a few minutes, you will be ready with your very first Android app that you can run on your phone. So, without further ado, let's begin!

If you can see a screen with two big blue windows saying DUMMY CONTENT, as seen in the preceding screenshot, you are good to start; otherwise simply navigate to the res/layout/ folder and double-click on activity_fullscreen.xml to open the XML layout in which we will be working now. 

Now, you can see many options in front of you; don't get overwhelmed or scared. You will soon learn and master the art of creating amazing user interfaces with the tools in front of you.