This article will teach you how to develop an Android Application step-by-step. For the beginners, I focus on teaching them to create a new android application with the help of Android Studio.
To start with Android Application Development, you need to take care of the following steps:
- Open the Android Studio and create a new project.
- In case you don’t have project opened in the Android Studio, you need to click on Start new Android Studio Project
- If you already have the project opened, click on File and then New Project.
- You’ll see that a new project screen will be opened in the window. Assign the following values:
- Application Name: “My Android Application”
- Company Domain: abc.com
- Rests of the fields like package name and project location are automatically filled by the Google. You can edit them according to you.
- Click on Next
- You’ll see the Target Android Device Keep the default values and click on Next button.
Now when it comes to selecting the Minimum Required SDK (it is the earliest version of android that you app supports indicated by the API level), choose the lowest version available in the list if you want your app to support as many devices as possible.
There might be some features that work only on newest versions. In that case, it is not mandatory to select the newest version. You can allow that feature to work on newer version and rest of the features on all the versions.
- Add an activity to mobile screen by selecting the Empty Activity. Then click on next.
- Again, without customizing the screen (unless necessary), keep the default values and click on next.
This can take a little while for processing. After the processing, Android Studio will open displaying Hello World app with the default files. Now you will be adding functionality to these files to create your own customized application.
Ensuring that your project window is open, have a look at the most important files of your android application from the drop-down list at the top:
App > java > com.example.myandroidapplication > mainactivity.java
This is the first file that appears in your window when you are done with the New Project Wizard. This file basically contains the class definition for the activity you created earlier.
app > res > layout > activity_main.xml
This is the xml file that presents and defines the layout of the activity.
app > manifests > AndroidManifest.xml
The manifest file describes the fundamental characteristics of the app and defines each of its components. You’ll revisit this file as you follow these lessons and add more components to your app.
Gradle Scripts > build.gradle
Android Studio uses Gradle to compile and build your app. There is a build.gradle file for each module of your project, as well as a build.gradle file for the entire project. Usually, you’re only interested in the build.gradle file for the module. In this case the app or application module. For more information about this file, see Building Your Project with Gradle.