A (175)

(Tuis.) #1
CHAPTER 7: Making Apps Interactive: Intents, Event Handling, and Menus 257

Note on the right side of the figure that the Android OS will provide an insertion point guide in blue
if you go back to edit any of the data values. If you click the OK button after entering the appropriate
numeric data value type, the onClick event will trigger the update to your Galaxy object’s
corresponding data fields, which we will visualize on your galaxy information screen during the next
chapter, when we continue to refine these Activity classes as well as their user interface designs by
using new UI layout classes, new UI widget classes, and new parameters for both. Learning Android
can be fun!


Summary


In this seventh chapter, you learned all about how to make your Android application interactive
by using Intent objects, Event Listeners, and an OptionsMenu object and its child MenuItem
object structures. You learned about how to leverage the most popular layout container, the
RelativeLayout class. You learned how to get the AVD emulator to launch an application if it gets
stalled, by using an AVD Manager dialog and its Start button, and how to “clear” snapshot data in
memory, to force Eclipse to “launch” a “virgin” AVD into system memory.


You created your second custom Java class, an Activity subclass called EditGalaxy, and designed
its UI design from scratch, using two important new UI widget classes used for Android application
design, the EditText and the Button classes. You learned some of the key configuration parameters
for both of these important widgets, and you even installed an impressive galaxy background
image, and adjusted your UI design’s contrast using the textColor and textColorHint parameters.
You also learned all about event handling, and how to implement an Android onClick( ) event
listener Java code structure to process the click and touch events on the OK Button UI elements in
your UI design.


Next, in Chapter 8, you will start to learn about some of the more complex Android UI layout
containers, such as the GridLayout, SlidingPaneLayout and ViewPager.

Free download pdf