更新时间:2021-07-09 19:36:44
封面
版权信息
Credits
Disclaimer
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Chapter 1. Activities
Introduction
Declaring an activity
Starting a new activity with an intent object
Switching between activities
Passing data to another activity
Returning a result from an activity
Saving an activity's state
Storing persistent activity data
Understanding the activity lifecycle
Chapter 2. Layouts
Defining and inflating a layout
Using RelativeLayout
Using LinearLayout
Creating tables – TableLayout and GridLayout
Using ListView GridView and Adapters
Changing layout properties during runtime
Optimizing layouts with the Hierarchy Viewer
Chapter 3. Views Widgets and Styles
Inserting a widget into a layout
Using graphics to show button state
Creating a widget at runtime
Creating a custom component
Applying a style to a View
Turning a style into a theme
Selecting theme based on the Android version
Chapter 4. Menus
Creating an Options menu
Modifying menus and menu items during runtime
Enabling Contextual Action Mode for a view
Using Contextual Batch Mode with a ListView
Creating a pop-up menu
Chapter 5. Exploring Fragments AppWidgets and the System UI
Creating and using a Fragment
Adding and removing Fragments during runtime
Passing data between Fragments
Creating a shortcut on the Home screen
Creating a Home screen widget
Adding Search to the Action Bar
Showing your app full screen
Chapter 6. Working with Data
Storing simple data
Read and write a text file to internal storage
Read and write a text file to external storage
Including resource files in your project
Creating and using an SQLite database
Access data in the background using a Loader
Chapter 7. Alerts and Notifications
Lights Action and Sound – getting the user's attention!
Creating a Toast using a custom layout
Displaying a message box with AlertDialog
Displaying a progress dialog
Lights Action and Sound Redux using Notifications
Creating a Media Player Notification
Making a Flashlight with a Heads-Up Notification
Chapter 8. Using the Touchscreen and Sensors
Listening for click and long-press events
Recognizing tap and other common gestures
Pinch-to-zoom with multi-touch gestures
Swipe-to-Refresh
Listing available sensors – an introduction to the Android Sensor Framework
Reading sensor data – using the Android Sensor Framework events
Reading device orientation
Chapter 9. Graphics and Animation
Scaling down large images to avoid Out of Memory exceptions
A transition animation – defining scenes and applying a transition
Creating a Compass using sensor data and RotateAnimation
Creating a slideshow with ViewPager
Creating a Card Flip Animation with Fragments
Creating a Zoom Animation with a Custom Transition
Chapter 10. A First Look at OpenGL ES
Set up the OpenGL ES environment
Drawing shapes on GLSurfaceView
Applying Projection and Camera View while drawing
Moving the triangle with rotation
Rotating the triangle with user input
Chapter 11. Multimedia
Playing sound effects with SoundPool
Playing audio with MediaPlayer
Responding to hardware media controls in your app
Taking a photo with the default camera app
Taking a picture using the (old) Camera API