How to create your first Hello World App for Android


What is Hello World App?
Well, a Hello World application or program may be considered as the most popular, the most fundamental and easiest programs in the world of programming languages. If you are interested in displaying a text, the beginners will love to program the language which displays the text ‘Hello World’. Yes, the most significant reason behind the use of this application is that it can also be used in the creation of non-text applications just like to light an LED. So, this programming language will teach you the basic operation of the syntax of any program and most important, the program is being executed properly. If you are interested in programming a language, starting with the Hello World may be a useful step for you at the beginning.
Requirement for the program setup
You can prefer the Windows 7 platform but it will work with any version of Windows.
Java Platform – JDK 6 Update 18
Eclipse IDE for Java Developers – v3.5 Galileo
Revision 4 in Android SDK tools
Steps to build your first Android App with Hello World
First of all, you need to create a brand new file of Android Project. Click on File, New and then Android Application.
It is the time to set the project properties like Project Name (Hello World); Application name (Hello World); Build Target (Android 2.1), package name (com.android.test) and create activity (HelloWorld). Press Finish then.
It is the perfect time to write the much needed code which is already located in a derived file in the name of HelloWorld.java. The layout file for your screen is main.xml and is available in the layout directory. Get active with the Layout mode. After clicking on ‘Hello World, Hello World’, select the option of Remove.
Drag a button to layout and edit the XML by clicking on ‘main.xml’. you will have to change this by ‘Click Me’ and Save the changes made.
You have to show something special when this button is pressed by the user. You need to import ‘android.widget.Button’ which can be done by the hotkey combination Ctrl-SHIFT-O after opening the file ‘HelloWorld.Java’ files.
You are then needed to add the appropriate code in line #5#6#10. In order to view the popup message, you will have to add the command to line #9
.
Now it is the show time. Just select the ‘Run > Run’. You will see the dialog box mentioned as ‘Run As’ and thereafter, you will have to select ‘Android Application’.
If you get an error in the name of Android AVD Error, you just need to click on ‘Yes’ option to get the brand new Android Virtual Device.
After selecting New, you will need to create new AVD in the options of Name (Android 2.1), Target (2.1 API Level 7) and SD Card Size (4000 MiB). After this, press on Create AVD and Run your application instantly.
In this way, you will be quite successful in creating the first Android application using the easiest programming language of Hello World. With time, you will learn to run more complicated programs.
Summary: – Hello World is a programming language which allows you to develop a program for your Android device. You can easily learn the codes and running methods of the applications through this language even if you are a beginner.

No comments:

Post a Comment

About

Hi Friends, I'm SoNu, Currently living In Bhopal,India. I'm Student Of Computer Science and Engineering, a Computer Enthusiast and a Newbie Blogger.

Amazon Deals