BEGINNER’S GUIDE TO MOBILE APP DEVELOPMENT IN ANDRIOD STUDIO
After the project is successfully created, the default view of the Android Studio will appear in which the middle pane will show the “MainActivity.java” file as shown below:
Figure 5.6. Default view in Android Studio
5.2. Developing the User Interface Let‟s open the user interface layout file activity_main.xml where we will place the button on the screen. As we can see from the figure above, the left pane shows the folders and files of our project. Make sure that the view type is Android and select the folders res layout and then double-click on the file activity_main.xml there as shown in Figure 5.7. When the activity_main.xml file is opened, the layout it contains will be shown in the middle pane as shown in Figure 5.8. This file and other xml files contain the layout information of an Android app in Android Studio. In fact, xml files are not only used in Android app development but also in other areas of computing. xml files are good to express the relations among different entities in a hierarchical way therefore is a good choice to use in layout design. xml files are text files but Android Studio interprets them as layouts as long as they are in the correct format. We can also view the text file representation of activity_main.xml in
90