Creating your first application in any programming language or style is a big achievement in itself and if this application is for the Android Platform, it is a great achievement for beginners. As by collecting drops of water, you can create a sea, by starting to learn Android Application development, you will definitely start to create more interactive and amazing applications for Android.
In this tutorial, we are going to create a simple “Hello World” Application for Android which will just display the text “Hello World” on-screen. Have you ever wondered why is “Hello World” the first application that you learn to make in any programming language?Well, I have always thought of the reason behind this but I was unable to figure out the reason.
At the time of writing this article, I thought of doing some research on this topic and found out on the internet that the text ” Hello World ” is used by teachers to teach the students basics of any programming language and to allow them to finish their first program as quickly as possible. This boosts up the confidence for the student and encourages the student to learn more of that programming language.
Without wasting any more of your precious time, let me begin with the actual tutorial. Before we begin, I would like you to know that you must have Eclipse installed on your computer and your Android Virtual Device Set up! In case you do not have any of those things, I recommend you to read these articles:
- Getting Started with Android App Development : Get your Tools Ready
- Set up an Android Virtual Device on Eclipse
Creating a Hello World Application in Android
- Launch Eclipse and also start your Android Virtual device. I am pretty sure that you are aware how to do that by now! If not, I suggest you to read the two articles I mentioned above.
- Go to File Menu -> New -> Android Application.
- Enter the Following details in the dialog box that appears and click next.
Let me explain you what all of this is.
- Application Name: The name of the application that will be visible to everyone when they install it on their device.
- Project Name: The name of the project for your reference in the Eclipse IDE.
- Package Name: This is the name that recognizes your application. It must be unique. The general format for making this is using your website name with the TLD (com) first and then your domain name after a “.” and at the end the name of the application.
- Minimum Required SDK: This is the minimum version of Android that your application needs to run successfully.
- Target SDK: The maximum version of Android that your application can support.
- Compile With: This is that version of SDK using which the application will be compiled. You should always choose the latest one to avoid any problems.
- Theme: This is the basic/default theme for your application. It can be anything that you like. For this tutorial, I would use the Holo Dark Theme.
- On the next screen, do not change anything but just click on next.
- Now you will be shown with a screen where you can design the icon for your application. Do some creative work here and design an icon for your application.
- On the next screen, choose a blank activity and click on next.
- Now just click on finish! You have successfully created your first Android Application, the legendary “Hello World” Application.
Now you should be presented with such a screen. This is how your application will look when you run it for the first time.
Run your First Android Application
In order to run your application, you either need an Android Virtual device or a Physical Android Device. For this tutorial, I will use an Android Virtual Device. Follow these steps to run your application for the first time.
- If you already have not, start your Android Virtual Device as discussed earlier.
- Now, Right click on your Project Name in the Project Explorer and choose Run As -> Android Application.
- Wait for Eclipse to build the application for you. When it is done, your application will be launched on the Android Virtual Device.
Well, That is all that I have for you today! Keep looking here at Slash Coding to find new tutorials on how to do various things on your Android Application. This is just the beginning. Keep subscribed to Slash Coding using your favorite Social Media. Like us on Facebook, Follow us on Twitter or Subscribe to our RSS Feeds.