Android development self-study note (Android Studio1.3.1)-2. Start the first Android Application, studio1.3.1android
I. Preface
Using Android Studio to develop Android applications is very simple, because it will help you automatically complete a lot of work. In this article, we mainly complete a simple application of clicking a button to display the current time in the text box.
How to use AS to complete a simple Android Application and tips for using.
Android Studio can be used to develop Android applications in the following three steps:
1. Create an Android Studio Project
2. Define the Application User Interface in XML Layout
3. Write Business implementation in Java code
2. Start the first Android Application 1. Create an Android Studio Project
In the first article, after the AS is installed, the AS welcome page will appear for the first time when the AS is opened, you can click "Start a new Android Studio project" under item 1 to create an Android Studio project, for example:
! Before talking about the following content, let's insert an AS tips:
We are writing the attribute"Android: onClick = "clickHandler"We didn't create this event before. At this time, we move the mouse to the row title position, and a light bulb icon will appear. We click it, the following four options are displayed:
Now we start to edit the background java logic code, complete functional operations, and find the java directory in the left-side organization tree, which stores our java code, find the MainActivity file corresponding to the package name. java.
Click the green triangle to run the program.
1. We can find the control element we are looking for through findViewById (R. id. show), but what is R ????
2. We know that the Res directory stores all the resources used by the Android Application. But how can we use it ???
3. What is the configuration file AndroidManifest. xml ????
4. How can I set the access permission for an application ??? For example, do I allow it to access WIFI ......
Coming soon .....