The document outlines the steps to create a new Android application project in Android Studio. It describes launching Android Studio, creating a new project called MyFirstApp, selecting a minimum SDK version, choosing an activity template, and reviewing the initial project files generated. Key files include AndroidManifest.xml, MainActivity.java, and activity_main.xml, which define app properties and contain the UI design and source code for the main activity.
The document outlines the steps to create a new Android application project in Android Studio. It describes launching Android Studio, creating a new project called MyFirstApp, selecting a minimum SDK version, choosing an activity template, and reviewing the initial project files generated. Key files include AndroidManifest.xml, MainActivity.java, and activity_main.xml, which define app properties and contain the UI design and source code for the main activity.
• The first step in the application development process is to create a new project within the Android Studio environment. • Begin, therefore, by launching Android Studio so that the “Welcome to Android Studio” screen appears. • Once this window appears, Android Studio is ready for a new project to be created. To create the new project, simply click on the “Start a new Android Studio project” button. • In the New Project Window set the Application Name field to MyFirstApp and keep the default value for the Project Location field. • Then click on the button Next to proceed. • Keep the default value for the minimum required SDK : API 16 Android 4.1 and click on Next button.
• The reason for selecting an older
SDK release is that this ensures that the finished application will be able to run on the widest possible range of Android devices. The higher the minimum SDK selection, the more the application will be restricted to newer Android devices. • When creating a new Android Studio Project a number of different templates are available as the starting point for the user interface of the main activity. • The most basic template are the blanck activity and the empty activity templates. • The Empty Activiy template creates a single layout file consisting of a RelativeLayout manager instance containing a TextView Object. • Click on Next button. • On the final screen keep the default value for Activity Name and Layout Name. The Activity Name field contains the name of the main activity of the application. • The field Layout Name contains the name of the resources file of the Activity. • At this point, Android Studio has created a minimal example application project. On the left hand side of the main project window several files have been generated by Android Studio. We find : • Manifests sub-directory which contains the AndroidManifest.xml file. This file defines the properties of the application. • java sub-directory which contains the source file of the application • res sub-directory which contains the resources of the application. The sub- folder layout contains the file • activity_main.xml which contains graphical resources of the application. • In the next steps of the tutorial we will mainly work with MainActivity.java and activity_main.xml files • By double clicking on activity_main.xml file you obtain the screen as is illustrated on the figure. • At the bottom of the Designer panel are two tabs labeled Design and Text respectively. • The content of the file activity_main.xml can be displayed by clicking on the Text tab. The design of the user interface can be visualized by clicking on the Design tab.
• We can make some changes to the user
interface by modifying the activity_main.xml file or by using the UI Designer tool.
• The user interface design for our activity is
stored in a file named activity_main.xml and the source code of our activity is stored In the file MainActivity.java • By double clicking on AndroidManifest.xml file you obtain the screen as is illustrated on the figure.
• The AndroidManifest.xml file
contains the properties of the application. For example if the application is attempting to access a file over internet, the appropriate permission to request internet access have to be added in this file.