Pages

Subscribe:

Ads 468x60px

10/16/11

Hello NEW Android! How to make simple Android App with Eclipse

Show Text, "Hello Android!!"

This is new easy app for a beginner (ME!^^a), let's start!!
 1.First is make a new project in Eclipse, File > New > Other > Android Project and should be like this :

 2.  Set the parameter.
3. There will come out something like this on the left bar : Main.java is place where we run the main program of the app. main.xml is place where we edited the Layout of Android app. res > layout > main.xml

4. For make a "Hello Android!!" text on the android screen. Just edit text in android:textlike this :
5. Run the program Ctrl+F11
Add a Widget
There are many tools for make Android App interesting, such as Button, CheckBox, RadioButton, etc which is called widget.
 To add a widget on your app, just drag it to Graphical Layout of your app. Rename it, then make an event for the new widget. For my app, I use widgets : EditText, TextView, and a Button, and I rename or just remembered its name. For TextView, i must write on it android:id="@+id/textViewHello" it.

Then, go to Main.java, then type this syntax on it. Every time when there's a mistake or error. Just click on it and click the solution which are provided by eclipse (usually just an solution to import the missing package).  class ButtonMove is a class for action whenever Button01 clicked. In my case, I print out:
"Helo (name input), congratz for yout new Android!"
where name input is from strNama variable which is got from EditText widget.

Then save and run it (Ctrl+F11), it would become like this :
It's Done!! :D 

0 comments:

Post a Comment