In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
In this article, the editor introduces in detail "how to use Android Studio to create an Android project", the content is detailed, the steps are clear, and the details are handled properly. I hope this "how to use Android Studio to create an Android project" article can help you solve your doubts.
First of all, let's introduce the basics of application development. We create a BaiHeng application. The engineer of Nanchang app Development Company explained that BaiHeng is a randomly chosen application name, and the application consists of an activity and a layout. Activity is a concrete instance of the Activity class in Android SDK, which is responsible for managing user interaction with the information screen. The function of the application is realized by writing an Activity subclass. Simple applications may require only one subclass, while complex applications may have multiple. BaiHeng is a simple application, so it has only one activity subclass called BaiHengActivity. BaiHengActivity manages the user interface shown in figure 1-1.
The layout defines a series of user interface objects and where they are displayed on the screen. The definitions that make up the layout are saved in the XML file. Each definition is used to create an object on the screen, such as a button or text message. The BaiHeng application contains a layout file called activity_quiz.xml. The XML tag in the layout file defines the user interface shown in figure 1-1. The relationship between BaiHengActivity and activity_quiz.xml files is shown in the figure.
1. Create an Android project
First, let's create an Android project. The Android project contains all the files that make up an application.
If you start the Android Studio program and run it for the first time, you will see the welcome dialog shown in figure 1-2.
In the welcome screen, select the option to create a new Android Studio project (Start a new Android Studio project); if not the first run, select File → New Project... Menu items are fine.
You should now open the New Project wizard interface. Enter BaiHeng at the application name (Application name) of this interface, as shown in figure 1-3. Enter android.bignerdranch.com at the company domain name (Company Domain). The automatically generated package name (Package name) becomes com.bignerdranch.android.geoquiz. As for the project storage location (Project location), it depends on your personal preference.
Figure 2
Figure 1-2 Welcome to Android Studio
Figure 1-3 create a new project
Note that the above package name follows the convention of "DNS inversion", that is, after the domain name of the enterprise organization or company is reversed, the application name is appended to the tail. Following this convention ensures the uniqueness of the package name so that various applications on the same device and in the Google Play store can be distinguished.
The minimum version of SDK is API 16: Android 4.1 (Jelly Bean), as shown in figure 1-4.
Figure 1-4 device support configuration
Click the Next button to continue. In the next window, you need to select a template for the startup initial screen of the BaiHeng application, as shown in figure 1-5. Click the Next button after selecting Empty Activity to continue.
In the last window of the application wizard, name the activity subclass BaiHengActivity, as shown in figure 1-6. Note the Activity suffix of the subclass name. Although not required, we recommend following this canonical naming convention.
Figure 1-6 configure the newly created activity
Create an android project load class process
Keep Generate Layout File selected. To reflect the correspondence between the layout and the activity, the layout name (Layout Name) is automatically updated to activity_quiz. The naming rule for the layout is to reverse the word order of activity names and convert all of them to lowercase letters, and then add underscores between words. This naming style is recommended for all layouts in subsequent chapters and other resources to be learned.
If there are other options in your version of Android Studio, leave the default selection unchanged. Click the Finish button, and Android Studio finishes creating and opens the new project.
2. Android Studio uses navigation
As shown in figure 1-7, Android Studio has opened the new project in the workspace window. The entire workspace window is divided into different areas, which are collectively referred to as tool windows (Tool Window).
On the left is the Project tools window (project tool window) view, which allows you to manage all project-related files.
Figure 1-7 New project window
In the middle is the code editing area (editor) view. To facilitate development, Android Studio opens the activity_quiz.xml file in the code editing area by default. (if you see a picture in the code area, you can click on the Text page at the bottom to switch.) Of course, you can also set the window on the right to preview the currently edited file.
Click the tool button area marked with various names on the left, right and bottom of the workspace window to show or hide all kinds of tool windows. Of course, you can also use their corresponding shortcut keys directly. If you can't see a tool button, you can click the gray square area in the lower left corner or click the View → Tool Buttons menu item to find it.
Read here, this "how to use Android Studio to create Android project" article has been introduced, want to master the knowledge of this article also need to practice and use in order to understand, if you want to know more about the article, welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.