CHAPTER 6: Android Screen Design: Writing to the Display Using Activity and View 181
Adding
Once this has been edited, copy and paste this
underneath itself, and then create text string constants for galaxy_name, galaxy_solar,
galaxy_habit, galaxy_colony, galaxy_pop, galaxy_fleet, and galaxy_ships named constants,
as shown in Figure 6-12, using the following XML mark-up:
Figure 6-12. Change the hello_world
Using Parameters to Configure Your LinearLayout
Now that we have the galaxy information screen’s data value holder string constants defined,
we can configure the LinearLayout UI layout container. As you can probably infer from the class
name, a LinearLayout class is used to create either rows of horizontal UI elements, or columns of
vertical UI elements, as we are doing here with vertically stacked TextView UI elements (widgets).
Let’s tell the
android:orientation parameter. To get the helper dialog containing all of the parameters that are
available for use with the LinearLayout class, type in the word “android” and then type a colon and
wait a second for the Eclipse child tag helper dialog to appear, as is shown in Figure 6-13.