Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Title
Copyright
Dedication
Contents at a Glance
Contents
About the Authors
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Exploring Custom Views
Planning a Custom View
Nature of Drawing in Android
Layout Phase: Measurement and Layout
Drawing Phase: Mechanics of onDraw
Implementing Measure Pass
Implementing Drawing through onDraw( )
Responding to Events
Saving View State
Rely on Activity Methods
Enabling the View for Self State Management
BaseSavedState Pattern
Custom Attributes
Complete Source Code for the Custom View
Implementing a Base Abstract View Class
CircleView Implementation
Defining Custom Attributes for the CircleView
Using the CircleView in a Layout
References
Summary
Review Questions
Chapter 2: Exploring Compound Controls
Planning a Duration Compound Control
Deriving from an Existing Layout
Creating the Layout file for the Compound Control
Specifying DurationControl in an Activity Layout
Working with Fragment Dialogs
Getting Access to a Fragment Manager
Invoking Fragment Dialogs
Creating DatePickerFragment Class
Constructing the DatePickerFragment
Restoring the Dialog Fragment State
Calling the Parent Back
Managing the View State for a Compound Control
Implementing the SavedState Class for DurationControl
Implementing Save and Restore State on Behalf of Child Views
Creating Custom Attributes for DurationControl
Extending an Existing View
Implementation Detail of DurationControl
DurationControl.java
/layout/duration_view_layout.xml
DatePickerFragment.java
Main Activity XML file
/values/attrs.xml
References
Summary
Review Questions
Chapter 3: Principles and Practice of Custom Layouts
Contrasting Custom Layouts
Custom Views
Compound Controls
Custom Layouts
Planning a Simple Flow Layout
Deriving from the ViewGroup Class
Defining custom attributes in Attrs.xml for the FlowLayout
Working with onMeasure( )
Implementing onLayout( )
Defining Custom LayoutParams
Overriding Custom LayoutParams Construction
Source Code for FlowLayout
FlowLayout in Action
Understanding ViewGroup.getChildMeasureSpec
References
Summary
Review Questions
Chapter 4: JSON for On-Device Persistence
Data Storage Options in Android
General Approach to Using JSON for Persistence
Working with GSON
Features of GSON
Adding the GSON Jar to Your Application
Planning Java Objects for GSON
Converting Java Objects to JSON
Using Shared Preferences for JSON Persistence
Getting Access to an Application Context
Saving and Restoring Strings Using Shared Preferences
Saving/Restoring Objects Using GSON in Shared Preferences
Using Internal Storage for JSON
Storing and Retrieving from Internal Storage
Storing JSON on External Storage
Using SQLite for Structured Storage
References
Summary
Review Questions
Chapter 5: Programming for Multiple Devices
Different Screen Densities
All About Pixels
Mapping Views to Densities
Density Scaling Factors
Resource Directories
Specifying Dimensions Using dp
Different Screen Sizes
Screen Size Buckets
Revisiting Layouts
Handling Screen Sizes with Layouts
Different Qualifiers Beyond Screens
Different Hardware Features
Using <uses-feature> Tags
Using <compatible-screens> and <supports-screens> Tags
Different Versions of Android
The <uses-sdk> Tag
The Compatibility Libraries
References
Summary
Review Questions
Chapter 6: Advanced Form Processing
Planning Form-Based Application
General Steps for Form Validation
Designing a BaseActivity
Design and Implementation of the FormActivity
Implementing the SignupActivityTestForm
Improvements to Creating Form-Based Activities
References
Summary
Review Questions
Chapter 7: Using the Telephony APIs
Working with SMS
Sending SMS Messages
Monitoring Incoming SMS Messages
Working with SMS Folders
Sending E-mail
Working with the Telephony Manager
Session Initiation Protocol (SIP)
References
Summary
Review Questions
Chapter 8: Advanced Debugging and Analysis
Enabling Advanced Debugging
The Debug Perspective
The DDMS Perspective
The Debug Button
The Heap Buttons
The Threads Buttons
The Stop Button
The Camera Button
The Dump View Hierarchy Button
The Systrace Button
The Start OpenGL Trace Button/Tracer for OpenGL ES
The Devices View Menu
Allocation Tracker
Traceview
Putting Your Debugging Skills to the Test
The Hierarchy View Perspective
Pixel Perfect View
The adb Command
The Emulator Console
StrictMode
StrictMode Policies
Turning off StrictMode
StrictMode Exercise
References
Summary
Review Questions
Chapter 9: Programming 3D Graphics with OpenGL
Fundamentals of OpenGL
Key Concepts in OpenGL
Essential Drawing with OpenGL ES 1.0
Understanding OpenGL Camera and Coordinates
Interfacing OpenGL ES with Android
Using GLSurfaceView and Related Classes
Implementing the Renderer
Using GLSurfaceView from an Activity
Changing Camera Settings
Using Indices to Add Another Triangle
Animating the Simple OpenGL Triangle
Braving OpenGL: Shapes and Textures
Working with Shapes
Working with Textures
Drawing Multiple Figures
OpenGL ES 2.0
Java Bindings for OpenGL ES 2.0
Rendering Steps
Understanding Shaders
Compiling Shaders into a Program
Getting Access to the Shader Program Variables
A Simple ES 2.0 Triangle
Spinning a Textured Cube
References
Summary
Reveiw Questions
Chapter 10: Introduction to Android Search
Exploring Android Global Search
Enabling Searchable Applications for Global Search
Activities and Search Key Interaction
Behavior of the Search Key on a Regular Activity
Behavior of an Activity that Disables Search
Explicitly Invoking Search through a Menu
Understanding Local Search
Enabling Type-to-Search
Using SearchView in the Action Bar
Defining the Search View Widget as a Menu Item
Identifying the Search Target for the Search View Widget
References
Summary
Review Questions
Chapter 11: Simple Search Suggestion Provider
Planning a Simple Suggestion Provider
Implementing the Simple Suggestion Provider
Search Results Activity
Working with Search Query String
Understanding onCreate( ) and onNewIntent( )
Testing for onNewIntent( )
Saving the Search Query
Exploring Search Metadata
Search Invoker Activity
Simple Suggestion Provider User Experience
References
Summary
Review Questions
Chapter 12: Custom Search Suggestion Provider
Planning the Custom Suggestion Provider
Implementing the custom SuggestUrlProvider
Understanding Suggestion Provider URIs
Implementing getType( ) to specify MIME Types
Implementing Content Provider Query Method
Overall Source Code for SuggestUrlProvider
Exploring Search Metadata
Understanding SearchSuggestAction Attribute
Understanding searchSuggestIntentData Attribute
Understanding searchSuggestPath Attribute
Understanding searchSuggestThreshold Attribute
Understanding queryAfterZeroResults Attribute
Implementing the Search Activity
SearchActivity Source Code
Details of Search Activity Invocation
Responding to ACTION_SEARCH and ACTION_VIEW
Search Activity Layout
Responding to onCreate( ) and onNewIntent( )
Notes on Finishing a Search Activity
Custom Suggestions Provider Manifest File
Custom Suggestion Provider User Experience
Using Action Keys and Application-Specific Search Data
Using Action Keys in Android Search
Working with Application-Specific Search Context
References
Summary
Review Questions
Chapter 13: Introduction to Cloud Storage with Parse
Planning a Sample Parse Application
Designing the Signup Activity
Designing the Login Screen
Designing the Password Reset Activity
Planning the Homepage of the Application
Showing the Users
Creating and Storing a Data Object
Querying for Words
Exploring Parse Basics
Understanding the Base ParseObject
Understanding a ParseUser Object
Understanding a ParseQuery Object
Setting up a Parse-Enabled Android Application
Creating a Parse Account and Application
Implementing the Sample Application
Implementing Signup
Detecting if the User Is Logged in or Not
Logging Out
Implementing Logging in
Implementing Reset Password
Querying for Users
Storing a Data Object in Parse: Create a Word
Querying and Populating Parse Objects
What’s Next
References
Summary
Review Questions
Chapter 14: Enhancing Parse with Parcelables
User Experience of the Sample Application
Passing ParseObjects as Parcelables
Revisiting Parcelables
A Simple Example of Implementing a Parcelable
Describing Contents and File Descriptors
Reading and Writing Members to a Parcel
The Write Time Parcelable Flags
Implementing Parcelable ParseObjectWrapper
Implementing writeToParcel( )
Field Transporters
What Is ParseObjectEssentials?
The Other Side: Recreating the ParseObjectWrapper
Parceling the Word
Implementing the Word Meanings List Activity
Passing Word as an Intent Extra
Recreating the Word from the Intent Extra
Using the Retrieved Word Object in the target Activity
Using the Retrieved Word to Search for Its Meanings
Creating the Meaning for a Word
References
Summary
Review Questions
Chapter 15: Exploring Push Notifications with Parse
Demonstrating Parse Push Notifications
Responding to a Push Notification
Push Notifications from a Client Program
Supporting Screens
Implementing Parse Push
Sending a Push Notification from the Parse Dashboard
Sending a Message to a Channel Using the Dashboard
Sending a Message Through a Client Program
Sending a Message as Data from a Client Program
Using Broadcast Receivers as Targets for Push Notifications
References
Summary
Review Questions
Index
← Prev
Back
Next →
← Prev
Back
Next →