售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Android Application Development Cookbook Second Edition
Table of Contents
Android Application Development Cookbook Second Edition
Credits
Disclaimer
About the Authors
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why Subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Activities
Introduction
Declaring an activity
Getting ready
How to do it...
How it works...
Starting a new activity with an intent object
Getting ready
How to do it...
How it works...
There's more...
See also
Switching between activities
Getting ready
How to do it...
How it works...
See also
Passing data to another activity
Getting ready
How to do it...
How it works...
There's more...
Returning a result from an activity
Getting ready
How to do it...
How it works...
There's more...
See also
Saving an activity's state
Getting ready
How to do it...
How it works...
There's more...
See also
Storing persistent activity data
Getting ready
How to do it...
How it works...
There's more...
Using more than one preference file
See also
Understanding the activity lifecycle
Getting ready
How to do it...
How it works...
There's more...
Shutting down an activity
2. Layouts
Introduction
Defining and inflating a layout
Getting ready
How to do it...
How it works...
There's more...
See also
Using RelativeLayout
Getting ready
How to do it...
How it works...
There's more...
See also
Using LinearLayout
Getting ready
How to do it...
How it works...
There's more...
See also
Creating tables – TableLayout and GridLayout
Getting ready
How to do it...
How it works...
There's more...
Using ListView, GridView, and Adapters
Getting ready
How to do it...
How it works...
There's more...
Changing layout properties during runtime
Getting ready
How to do it....
How it works...
Optimizing layouts with the Hierarchy Viewer
Getting ready
How to do it...
How it works...
There's more...
3. Views, Widgets, and Styles
Introduction
Inserting a widget into a layout
Getting ready
How to do it...
How it works...
There's more...
See also
Using graphics to show button state
Getting ready
How to do it...
How it works...
There's more...
Using designated folders for screen-specific resources
See also
Creating a widget at runtime
Getting ready
How to do it...
How it works...
There's more...
Creating a custom component
Getting ready
How to do it...
How it works...
There's more...
See also
Applying a style to a View
Getting ready
How to do it...
How it works...
There's more...
See also
Turning a style into a theme
Getting ready
How to do it...
How it works...
There's more...
Selecting theme based on the Android version
Getting ready
How to do it...
How it works...
There's more…
4. Menus
Introduction
Creating an Options menu
Getting ready
How to do it...
How it works...
There's more...
Using a menu item to launch an activity
Creating sub menus
Grouping menu items
See also
Modifying menus and menu items during runtime
Getting ready
How to do it...
How it works...
There's more...
Enabling Contextual Action Mode for a view
Creating a Floating Context Menu
Getting ready
How to do it...
How it works...
There's more...
See also
Using Contextual Batch Mode with a ListView
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a pop-up menu
Getting ready
How to do it...
How it works...
5. Exploring Fragments, AppWidgets, and the System UI
Introduction
Creating and using a Fragment
Getting ready
How to do it...
How it works...
There's more...
Adding and removing Fragments during runtime
Getting ready
How to do it...
How it works...
There's more...
Passing data between Fragments
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a shortcut on the Home screen
Getting ready
How to do it...
How it works...
There's more...
Creating a Home screen widget
Getting ready
How to do it...
How it works...
There's more...
See also
Adding Search to the Action Bar
Getting ready
How to do it...
How it works...
See also
Showing your app full screen
Getting ready
How to do it...
How it works...
There's more...
Sticky Immersion
Dimming the System UI
Setting the Action Bar as an Overlay
Translucent system bars
See also
6. Working with Data
Introduction
Storing simple data
Getting ready
How to do it...
How it works...
There's more...
Read and write a text file to internal storage
Getting ready
How to do it...
How it works...
There's more...
Cache Files
See also
Read and write a text file to external storage
Getting ready
How to do it...
How it works...
There's more...
Getting public folders
Checking available space
Deleting a file
Working with directories
Preventing files from being included in galleries
See also
Including resource files in your project
Getting ready
How to do it...
How it works...
There's more...
See also
Creating and using an SQLite database
Getting ready
How to do it...
How it works...
There's more...
Upgrading a database
See also
Access data in the background using a Loader
Getting ready
How to do it...
How it works...
There's more...
See also
7. Alerts and Notifications
Introduction
Lights, Action, and Sound – getting the user's attention!
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a Toast using a custom layout
Getting ready
How to do it...
How it works...
Displaying a message box with AlertDialog
Getting ready
How to do it...
How it works...
There's more...
Add an icon
Using a list
Custom Layout
Displaying a progress dialog
Getting ready
How to do it...
How it works...
There's more...
Lights, Action, and Sound Redux using Notifications
Getting ready
How to do it...
How it works...
There's more...
Adding a button to the notification using addAction()
Expanded notifications
Lock screen notifications
See also
Creating a Media Player Notification
Getting ready
How to do it...
How it works...
There's more...
See also
Making a Flashlight with a Heads-Up Notification
Getting ready
How to do it...
How it works...
There's more...
See also
8. Using the Touchscreen and Sensors
Introduction
Listening for click and long-press events
Getting ready
How to do it...
How it works...
There's more...
Recognizing tap and other common gestures
Getting ready
How to do it...
How it works...
There's more...
See also
Pinch-to-zoom with multi-touch gestures
Getting ready
How to do it...
How it works...
Swipe-to-Refresh
Getting ready
How to do it...
How it works...
There's more...
Listing available sensors – an introduction to the Android Sensor Framework
Getting ready
How to do it...
How it works...
There's more...
See also
Reading sensor data – using the Android Sensor Framework events
Getting ready
How to do it...
How it works...
There's more...
Environment sensors
Position sensors
Motion sensors
See also
Reading device orientation
Getting ready
How to do it...
How it works...
There's more...
Getting current device rotation
See also
9. Graphics and Animation
Introduction
Scaling down large images to avoid Out of Memory exceptions
Getting ready
How to do it...
How it works...
There's more...
See also
A transition animation – defining scenes and applying a transition
Getting ready
How to do it...
How it works...
Creating the start scene
Creating the transition:
Defining the ending scene:
Starting the transition:
There's more...
See also
Creating a Compass using sensor data and RotateAnimation
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a slideshow with ViewPager
Getting ready
How to do it...
How it works...
There's more...
Creating a Setup Wizard
See also
Creating a Card Flip Animation with Fragments
Getting ready
How to do it...
How it works...
See also
Creating a Zoom Animation with a Custom Transition
Getting ready
How to do it...
How it works...
There's more...
Getting the default animation duration
See also
10. A First Look at OpenGL ES
Introduction
Set up the OpenGL ES environment
Getting ready
How to do it...
How it works...
Declaring OpenGL in the Android Manifest
Extending the GLSurfaceView class
Creating an OpenGL rendered class
There's more...
Drawing shapes on GLSurfaceView
Getting ready
How to do it...
How it works...
There's more...
See also
Applying Projection and Camera View while drawing
Getting ready
How to do it...
How it works...
There's more...
Moving the triangle with rotation
Getting ready
How to do it...
How it works...
There's more...
The render mode
Rotating the triangle with user input
Getting ready
How to do it...
How it works...
There's more...
See also
11. Multimedia
Introduction
Playing sound effects with SoundPool
Getting ready
How to do it...
How it works...
There's more...
See also
Playing audio with MediaPlayer
Getting ready
How to do it...
How it works...
There's more...
Playing music in the background
Using hardware volume keys to control your app's audio volume
See also
Responding to hardware media controls in your app
Getting ready
How to do it...
How it works...
There's more...
Checking the hardware being used
See also
Taking a photo with the default camera app
Getting ready
How to do it...
How it works...
There's more...
Calling the default video app
See also
Taking a picture using the (old) Camera API
Getting ready
How to do it...
How it works...
There's more...
Setting the camera parameters
See also
Taking a picture using the Camera2 (the new) API
Getting ready
How to do it...
How it works...
Setting up the preview
Capturing the image
There's more...
See also
12. Telephony, Networks, and the Web
Introduction
How to make a phone call
Getting ready
How to do it...
How it works...
See also
Monitoring phone call events
Getting ready
How to do it...
How it works...
There's more...
See also
How to send SMS (text) messages
Getting ready
How to do it...
How it works...
There's more...
Multipart messages
Delivery status notification
See also
Receiving SMS messages
Getting ready
How to do it...
How it works...
There's more...
Reading existing SMS messages
See also
Displaying a web page in your application
Getting ready
How to do it...
How it works...
There's more...
Controlling page navigation
How to enable JavaScript
Enable built-in zoom
See also
Checking online status and connection type
Getting ready
How to do it...
How it works...
There's more...
Monitoring network state changes
See also
Getting started with Volley for Internet requests
Getting ready
How to do it...
How it works...
There's more...
See also
Canceling a Volley request
Getting ready
How to do it...
How it works...
There's more...
Using Volley to request a JSON response
Getting ready
How to do it...
How it works...
There's more...
See also
Using Volley to request an image
Getting ready
How to do it...
How it works...
There's more...
Creating a Volley singleton
See also
Using Volley's NetworkImageView and ImageLoader
Getting ready
How to do it...
How it works...
There's more...
See also
13. Getting Location and Using Geofencing
Introduction
How to get the last location
Getting ready
How to do it...
How it works...
There's more...
Mock locations
See also
Resolving problems reported with the GoogleApiClient OnConnectionFailedListener
Getting ready
How to do it...
How it works...
There's more...
See also
How to receive location updates
Getting ready
How to do it...
How it works...
There's more...
Stop receiving location updates
See also
Create and monitor a Geofence
Getting ready
How to do it...
How it works...
There's more...
See also
14. Getting your app ready for the Play Store
Introduction
The new Android 6.0 Run-Time permission model
Getting ready
How to do it...
How it works...
There's more...
See also
How to schedule an alarm
Getting ready
How to do it...
How it works...
There's more...
Cancel the alarm
Repeating alarm
See also
Receive notification of device boot
Getting ready
How to do it...
How it works...
There's more...
See also
Using the AsyncTask for background work
Getting ready
How to do it...
How it works...
There's more...
Parameter types
Cancel the task
See also
Adding speech recognition to your app
Getting ready
How to do it...
How it works...
There's more...
See also
Push Notification using GCM
Getting ready
How to do it...
How it works...
There's more...
Simple testing option
See also
How to add Google sign-in to your app
Getting ready
How to do it...
How it works...
There's more...
Localization resources
See also
15. The Backend as a Service Options
Introduction
App42
Getting ready
How to do it...
How it works...
There's more...
See also
Backendless
Getting ready
How to do it...
How it works...
There's more...
See also
Buddy
Getting ready
How to do it...
How it works...
There's more...
See also
Firebase
Getting ready
How to do it...
How it works...
There's more...
See also
Kinvey
Getting ready
How to do it...
How it works...
There's more...
See also
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜