1. Create an Android Project
In the create dialog box, enter the App attributes. Select the latest SDK version, which is not compatible with the version. Select Holo Dark as the topic.
Next, use the default settings
Next, use the default settings
Next, use the default configuration
Next, use the default settings
Initial screen after creation
In the above step, we chose to create MainActivity, and ADT helped us generate MainActivity under the src directory. java file. The activity_main.xml file is generated in the res/layout/directory and opened in the editing window. For example, it is a UI definition file, which is a standard xml file, the displayed image is depicted in the xml file parsed by the editor. Click "Graphical Layout" and "activity_main.xml" below to switch between the graphic editing and xml text editor.
To make the project structure clear, we create a new package for activity:
Set the package name to ui. activity.
Change the display mode of Package Explorer to Hierarchical.
Drag MainActivity. java to the ui. activity package. The update dialog box is displayed. Select OK.
Because the location of the activity is changed, we need to update AndroidManifest. xml to correct the Application configuration.
For example, double-click AndroidManifest. xml: select the Application tab, and select MainActivity in Application Nodes. The Name attribute on the right is incorrect. Click Browse to reselect and set it to com. lingsmm. purelunarcalendar. ui. acivity
Continue to the drop-down list and set Screen orientation to "sensorLandscape", indicating that the Screen direction is horizontal and the gravity direction is adjusted.
At the top of the page editing window is the toolbar:
1: multi-screen preview. If your program is compatible with devices of multiple sizes, you can select this option.
2: set the size of the main screen (our application is incompatible, only for google Nexus 7, select Nexus 7, and edit the layout on the 10 screen)
3: screen direction. Select landscape
4: Subject
5: The associated Java class, which is created by the Context instance.
6: multi-language support.
7. Select a system version. If multiple versions are compatible, you can select different versions for preview.