After all applications that we need to make the application for the Android installed. It’s time to start to make our first Android app, usually in another programming language the initial application is the “Hello World”.
1. After ensuring all necessary tools is installed. On the menu bar, click File> New> Android Application Project. As shown below.
2. Then, enter information such as; Application Name, Project Name, and Package Name. Need to remember to include the minimum SDK dan SDK target. Minimum SDK is where the lower Android version that the application will function. While the target SDK is the current Android higher version that can be used to run the application. In the latest version there will be an option to specify the version of Android that is used to perform Compile for the application. Enter the version of Android that is equal to the minimum SDK. This time we use the Android version 2.2 (Froyo) with a number of API 8. While the theme, we set to none.
After that, we click Next.
3. In this third phase we will configure our application project. Uncheck all application project configurations. Uncheck all except for the Create Activity section and the Create Project in Workspace.
4. On the fourth stage, it will ask us to choose what type of Activity what we will use in our application. We will choose the Blank Activity.
After that, click Next.
6. Our new application has been created. Open Eclipse and double-click on the Hello World project. It will show the structure of the Android application as shown below.
In the picture we see the main structure of folders on Android. Namely the src folder, genes, assets, son, libs, and res. Each folder has its own function, here is the following explanation.
- src: stand for the source, its uses is to store files like .java source code of the application that we created.
- gene: stands for generated, its contain files that were created automatically by Android. We cannot manually edit these files. Its uses is to manage the resources that exist in our application.
- assets: Contains files that become assets of our application, such as .txt or .html file
- bin: it’s stands for binary file
- libs: contains libraries that we use in our application. Because we created a simple application, so we will use the main library of the Android OS version 2.2.
- res: stand for the resource, containing the files that is a source of our application. Such as layout files, image files, audio and so on. In general the files are in .xml extension. Because Android application using a layout with .xml file.
In Android, there are three important files. That this R.java file that is used to access the resource. AndroidManifest.xml file is the configuration/setting’s application. And last but not least is the file Android 2.2 which is the main library to run an application. The application cannot run if there is a third file.
7. Try to run the application. Right click on the project Hello World. Then select Run As> Android Application.
8. Then it will appear an Android emulator with based library used Android 2.2, we have to wait for the boot process is complete. If the boot process has been completed, we have the Hello World application view that we have made:
9. Our first Android application has been successfully created.
For the next tutorial visit our website www.socmedtech.com. Hopefully this article can help to expand our knowledge and provide benefits for us all.
What programming language do you prefer?