A (175)

(Tuis.) #1

xii Contents


Instantiate an Intent Object: An App’s Context  226
Explaining Context: The Android Context Class  227
Creating Your Second Activity: The EditGalaxy Class  228
Starting an Activity: Using the startActivity( ) Method  231
Coding the onCreate( ) Method: Using setContentView( )  232
Creating an EditGalaxy UI: Using a RelativeLayout  233
Using Editable Text Fields: The EditText Widget  234
Using Buttons in UI Designs: The Button Widget 235
Aligning Widgets Using RelativeLayout Parameters  235
Using the Eclipse Graphical Layout Editor (GLE)  237
Giving an EditText Field a Hint for Your Users  238
Aligning Several UI Elements Using RelativeLayout Parameters  240
Adding EditGalaxy to Your App: Editing Your AndroidManifest  243
Finishing Up the RelativeLayout UI Design  244
Using Baseline Alignment: The layout_alignBaseline Parameter  247
Adding a Graphics Asset to the RelativeLayout Container  249
Event Handling: Using Event Listeners  251
Creating an Event Listener: onClickListener( )  251
Creating an Event Listener: onClickListener( )  252
Making the Galaxy Object Accessible: Using The static Keyword  254
Transferring EditText Data to the Galaxy Object Using parse( ) Methods  255

Summary  257


■ Chapter 8: Android UI Design: Using Advanced ViewGroup Layout Containers ������������� 259


Using the Android GridLayout UI Container  260
GridLayout Class: Grid-Based UI Layout Designs  260
Using the rowSpec and columnSpec Parameters  261
GridLayout Location, Flexibility, and Gravity  262
The GridLayoutLayoutParams Nested Class: Parameters  263
The GridLayoutAlignment Nested Class: Alignment Constants  265

Converting a RelativeLayout UI to a GridLayout  268
Upgrading Your HelloUniverse App to Android 4 0  269
GridLayout Parent Parameters: Let’s Experiment!  272
Free download pdf