Android: My First App (Eclipse)

Step one

Make sure that you have the latest Android Software Development Kit (SDK) and Android Developer Tools (ADT) installed, along with Eclipse.

Step two

Create a new Android Application Project.


Step three

Give application, project and package a name.

Step four

Skip through the launcher icon details.

Step five

Choose an activity type (BlankActivity).

Step six

View your app's activity_main.xml file located in the res/layout folder

Step seven

At the bottom of the central window you will see that we are currently in the Graphical Layout. Now click the activity_main.xml tab next to Graphical Layout one and you will see the following.


Step eight

In the activity_mail.xml file (above) try changing:

    android:text="@string/hello_world"

to something else, like:

    android:text="@string/hello_android"


and you will receive an error. So change it back to "hello_world" because this isn't the text, it is a pointer to a string, which can be found in the res/values folder in a file called strings.xml. And it is in this file that we can highlight our string called hello_world and change its value to Hello Android!

Step nine

Return to your activity_main.xml to see the change in the Graphical Layout or press the green play button to run in an emulator. (You might need to run twice, since the unlocking of the emulator device the first time round seems to always get in the way of the app running.)

Comments