This lesson is focused on creating first Android App using ADT bundle. (Install ADT bundle as discussed in Installation blog.)
- In Android Studio, create a new project.
- If its Welcome screen, click New Project.
- If a project is opened, select New Project from File Menu.
- The Create New Project screen appears.
- For Application Name use “Hello_World2”.
- For the other fields, use the default values and click Next
Brief Description :
- Application Name is the app name that appears to users.
- Company domain provides a qualifier that will be appended to the package name; Android IDE will remember this qualifier for each new project you create.
- Package name is the fully qualified name for the project (following the same rules as those for naming packages in the Java programming language).
- Project location is the directory on your system that holds the project files.
- Under Target Android Devices, accept the default values and click Next.
- The Minimum Required SDK is the earliest version of Android that your app supports, indicated using the API level. To support as many devices as possible, you should set this to the lowest version available.
- Under Add an Activity, select Empty Activity and click Next.
This created a basic Android project as “Hello World” app that contains some default files. We will see some of them :
- app/src/main/java/com.example.hello_world2/MainActivity.java : It contains the class definition for the activity you created earlier. When you build and run the app, the Activity starts and loads the layout file that says “Hello World!”
- app/src/main/res/layout/activity_main.xml:This XML file defines the layout of the activity. It contains a TextView element with the text “Hello world!”.
- app/src/main/AndroidManifest.xml : The manifest file describes the fundamental characteristics of the app and defines each of its components.