- Learning Android Game Development
- Nikhil Malankar
- 833字
- 2021-07-09 20:41:19
Creating your first Android Studio project
Open your Android Studio, and click on Start a new Android Studio project, as shown in the following screenshot:

Once you start a new project, you will see the following screenshot:

In this screen, fill in the details of your first Android app:
- Application name is the name of your app, which will appear on the icon of your phone when it is installed.
- Company Domain is an identifier for your app. Make sure that you keep this common throughout your apps for better organization and convention.
- Package name is another important unique identifier for your app. We learned about this in our first chapter and saw its naming conventions. Refer to that part if you have any doubts regarding package names and their naming.
- Include C++ support is optional. For the purpose of this book, we will keep it unchecked for now.
- Project location is the path where your project folder will be situated on your computer.
Once you are ready after filling in all these details, press Next.
Now, you will see this screen:

For the purpose of this book, we will only work with Phone and Tablet. However, you can try experimenting with other platforms as well, once you are comfortable with the development cycle.
Minimum SDK is the OS version that would be required as a minimum factor to run your app. It is recommended that you select the lowest version for your app to run on as many OS versions as possible. However, do note that some functions are deprecated from further versions, so it is recommended that you use Minimum API 14: Android 4.0 (IceCreamSandwich) for hassle-free development. You will also be prompted about how many devices will be supporting your app, as you can see in the image. These figures are real time and change as the market share of an OS changes.
Once we select our Fullscreen Activity, press Next, as follows:

You could say that an activity is simply a default layout. Since we are creating a game, we will use a Fullscreen Activity. As you can see in the preceding screenshot, you have many different activity options to choose from, which are quite self-explanatory on their own. So, let's select Fullscreen Activity and press Next:

Activity Name is the name of your Java class that will be generated. We will be working with this file a lot, so make sure that you remember it.
Layout Name is the name of the XML file, which will deal with how and what components will appear on your app visually. There are some naming conventions that need to be followed for XML files. They are as follows:
- Names must be all lowercase
- An underscore is used to separate two words instead of spaces.
- Always prefix the filename with the type of resources; for instance, if your XML file corresponds to an activity such as MainActivity.java, then your filename would be activity_main.xml.
- If you have a subitem of a specific group, such as a list item of main activity, then it can be named by suffixing it as activity_main_list_item.xml.
- This way, you can either suffix or prefix a keyword for your filename, as you prefer.
Title is the name that will appear on the top bar of your app. The title you use for the Activity and the class name of the main Activity might be different; titles may also contain spaces.
Once you are finished with all of this, click on Finish and give yourself a pat on the back. You have successfully learned how to create an Android Studio Project. After this, wait for a few seconds/minutes depending on your system's performance for your project to set up; once it is ready, you will see the following screen:

If for some reason, you are not able to see this screen after waiting, then click on the 1: Project option, which is vertically aligned below FirstGame on the upper-left corner of the screen.
Congratulations! You have successfully created your first app now. At this point, you can go ahead and run the project and see how it runs on the emulator; however, before we do that, let's walk through the project folder structure of this project. Let's expand each folder to understand it further. Now, this part is very important, since this will serve as a foundation for almost every basic thing you will be doing in Android Studio, so make sure that you understand this properly.
- 顯卡維修知識精解
- 數字道路技術架構與建設指南
- BeagleBone By Example
- Linux運維之道(第2版)
- 硬件產品經理手冊:手把手構建智能硬件產品
- Camtasia Studio 8:Advanced Editing and Publishing Techniques
- 筆記本電腦應用技巧
- Hands-On Artificial Intelligence for Banking
- 超大流量分布式系統架構解決方案:人人都是架構師2.0
- Intel Edison智能硬件開發指南:基于Yocto Project
- Managing Data and Media in Microsoft Silverlight 4:A mashup of chapters from Packt's bestselling Silverlight books
- Blender Game Engine:Beginner's Guide
- Intel FPGA權威設計指南:基于Quartus Prime Pro 19集成開發環境
- 微控制器的應用
- Drupal Rules How-to