Expand the res folder followed by the layout folder and double click on the activity_main.xml. The Hello World app will be displayed.
Click on the magnifying glass that contains the number 1 above the preview window to enlarge the app or click on the positive + magnifying glass.
The main things of interest on this android app are the title and the text view. The TextView is used to display text. Click on the Hello World! TextView. The properties on the right hand side will appear. If the properties window isn’t displayed go to Window –> Show View –> Outline.
There are various option that can be set for this TextView including text colour, the size, font family and the actual content. Click on the property that is labelled as Text.
Click in the area highlight above and enter the words Hello Android. This will change the TextView on the app. Notice that a small yellow icon appears next to the TextView. This appears as a warning that we are using hard coded text string and not text from a resource file. Resource file will be explained later but for now just ignore the warning. The program that does this checking for you is called the Lint Tool. When a warning or error appears it will either display a yellow warning icon for warning or a red cross icon for an error. In addition to this lint will information you the error by displaying a number as in the screen shot below.
Click on this red icon. A lint warning window will be displayed explaining that there is a warning relating to your layout file.
A description of the error is also displayed letting you know what the issue is and some information regarding why it isn’t good practice to do this. One of these is that the application language can’t be translated. Click the OK button.
If the emulator isn’t already running, click on the Android Device Manager and select the Nexus S configuration.
When the emulator has loaded, right click on the project name and select Build Project. Confirm that there are no errors and right click the project name again but this time select, Run As –> Android Application.
Switch to the emulator and you will see your app running containing the words Hello Android.
Next Android Game Programming Week 2- Day 3.0 Deploying the App >>