Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Table of Contents
1 Overview of Android
The Evolution of Android
The Dichotomy of Android
Devices Running Android
HTC Models
Motorola Models
Samsung Models
Tablets
Other Devices
HTC Models
Motorola Models
Samsung Models
Tablets
Other Devices
Hardware Differences on Android Devices
Screens
User Input Methods
Sensors
Screens
User Input Methods
Sensors
Features of Android
Multiprocess and App Widgets
Touch, Gestures, and Multitouch
Hard and Soft Keyboards
Multiprocess and App Widgets
Touch, Gestures, and Multitouch
Hard and Soft Keyboards
Android Development
How to Use the Recipes in This Book
Designing Applications Well
Maintaining Forward Compatibility
Robustness
How to Use the Recipes in This Book
Designing Applications Well
Maintaining Forward Compatibility
Robustness
Software Development Kit
Installing and Upgrading
Software Features and API Level
Emulator and Android Device Debug
Using the Android Debug Bridge
Signing and Publishing
Installing and Upgrading
Software Features and API Level
Emulator and Android Device Debug
Using the Android Debug Bridge
Signing and Publishing
Android Market
End-User License Agreement
Improving App Visibility
Differentiating an App
Charging for an App
Managing Reviews and Updates
Alternatives to the Android Market
End-User License Agreement
Improving App Visibility
Differentiating an App
Charging for an App
Managing Reviews and Updates
Alternatives to the Android Market
The Evolution of Android
The Dichotomy of Android
Devices Running Android
HTC Models
Motorola Models
Samsung Models
Tablets
Other Devices
HTC Models
Motorola Models
Samsung Models
Tablets
Other Devices
Hardware Differences on Android Devices
Screens
User Input Methods
Sensors
Screens
User Input Methods
Sensors
Features of Android
Multiprocess and App Widgets
Touch, Gestures, and Multitouch
Hard and Soft Keyboards
Multiprocess and App Widgets
Touch, Gestures, and Multitouch
Hard and Soft Keyboards
Android Development
How to Use the Recipes in This Book
Designing Applications Well
Maintaining Forward Compatibility
Robustness
How to Use the Recipes in This Book
Designing Applications Well
Maintaining Forward Compatibility
Robustness
Software Development Kit
Installing and Upgrading
Software Features and API Level
Emulator and Android Device Debug
Using the Android Debug Bridge
Signing and Publishing
Installing and Upgrading
Software Features and API Level
Emulator and Android Device Debug
Using the Android Debug Bridge
Signing and Publishing
Android Market
End-User License Agreement
Improving App Visibility
Differentiating an App
Charging for an App
Managing Reviews and Updates
Alternatives to the Android Market
End-User License Agreement
Improving App Visibility
Differentiating an App
Charging for an App
Managing Reviews and Updates
Alternatives to the Android Market
2 Application Basics: Activities and Intents
Android Application Overview
Recipe: Creating a Project and an Activity
Directory Structure of Project and Autogenerated Content
Android Package and Manifest File
Renaming Parts of an Application
Recipe: Creating a Project and an Activity
Directory Structure of Project and Autogenerated Content
Android Package and Manifest File
Renaming Parts of an Application
Activity Lifecycle
Recipe: Utilizing Other Lifecycle Functions
Recipe: Forcing Single Task Mode
Recipe: Forcing Screen Orientation
Recipe: Saving and Restoring Activity Information
Recipe: Utilizing Other Lifecycle Functions
Recipe: Forcing Single Task Mode
Recipe: Forcing Screen Orientation
Recipe: Saving and Restoring Activity Information
Multiple Activities
Recipe: Using Buttons and TextView
Recipe: Launching Another Activity from an Event
Recipe: Launching an Activity for a Result Using Speech to Text
Recipe: Implementing a List of Choices
Recipe: Using Implicit Intents for Creating an Activity
Recipe: Passing Primitive Data Types Between Activities
Recipe: Using Buttons and TextView
Recipe: Launching Another Activity from an Event
Recipe: Launching an Activity for a Result Using Speech to Text
Recipe: Implementing a List of Choices
Recipe: Using Implicit Intents for Creating an Activity
Recipe: Passing Primitive Data Types Between Activities
Android Application Overview
Recipe: Creating a Project and an Activity
Directory Structure of Project and Autogenerated Content
Android Package and Manifest File
Renaming Parts of an Application
Recipe: Creating a Project and an Activity
Directory Structure of Project and Autogenerated Content
Android Package and Manifest File
Renaming Parts of an Application
Activity Lifecycle
Recipe: Utilizing Other Lifecycle Functions
Recipe: Forcing Single Task Mode
Recipe: Forcing Screen Orientation
Recipe: Saving and Restoring Activity Information
Recipe: Utilizing Other Lifecycle Functions
Recipe: Forcing Single Task Mode
Recipe: Forcing Screen Orientation
Recipe: Saving and Restoring Activity Information
Multiple Activities
Recipe: Using Buttons and TextView
Recipe: Launching Another Activity from an Event
Recipe: Launching an Activity for a Result Using Speech to Text
Recipe: Implementing a List of Choices
Recipe: Using Implicit Intents for Creating an Activity
Recipe: Passing Primitive Data Types Between Activities
Recipe: Using Buttons and TextView
Recipe: Launching Another Activity from an Event
Recipe: Launching an Activity for a Result Using Speech to Text
Recipe: Implementing a List of Choices
Recipe: Using Implicit Intents for Creating an Activity
Recipe: Passing Primitive Data Types Between Activities
3 Threads, Services, Receivers, and Alerts
Threads
Recipe: Launching a Secondary Thread
Recipe: Creating a Runnable Activity
Recipe: Setting a Thread’s Priority
Recipe: Canceling a Thread
Recipe: Sharing a Thread Between Two Applications
Recipe: Launching a Secondary Thread
Recipe: Creating a Runnable Activity
Recipe: Setting a Thread’s Priority
Recipe: Canceling a Thread
Recipe: Sharing a Thread Between Two Applications
Messages Between Threads: Handlers
Recipe: Scheduling a Runnable Task from the Main Thread
Recipe: Using a Countdown Timer
Recipe: Handling a Time-Consuming Initialization
Recipe: Scheduling a Runnable Task from the Main Thread
Recipe: Using a Countdown Timer
Recipe: Handling a Time-Consuming Initialization
Services
Recipe: Creating a Self-Contained Service
Recipe: Creating a Self-Contained Service
Adding a Broadcast Receiver
Recipe: Starting a Service When the Camera Button Is Pressed
Recipe: Starting a Service When the Camera Button Is Pressed
App Widgets
Recipe: Creating an App Widget
Recipe: Creating an App Widget
Alerts
Recipe: Using Toast to Show a Brief Message on the Screen
Recipe: Using an Alert Dialog Box
Recipe: Showing Notification in Status Bar
Recipe: Using Toast to Show a Brief Message on the Screen
Recipe: Using an Alert Dialog Box
Recipe: Showing Notification in Status Bar
Threads
Recipe: Launching a Secondary Thread
Recipe: Creating a Runnable Activity
Recipe: Setting a Thread’s Priority
Recipe: Canceling a Thread
Recipe: Sharing a Thread Between Two Applications
Recipe: Launching a Secondary Thread
Recipe: Creating a Runnable Activity
Recipe: Setting a Thread’s Priority
Recipe: Canceling a Thread
Recipe: Sharing a Thread Between Two Applications
Messages Between Threads: Handlers
Recipe: Scheduling a Runnable Task from the Main Thread
Recipe: Using a Countdown Timer
Recipe: Handling a Time-Consuming Initialization
Recipe: Scheduling a Runnable Task from the Main Thread
Recipe: Using a Countdown Timer
Recipe: Handling a Time-Consuming Initialization
Services
Recipe: Creating a Self-Contained Service
Recipe: Creating a Self-Contained Service
Adding a Broadcast Receiver
Recipe: Starting a Service When the Camera Button Is Pressed
Recipe: Starting a Service When the Camera Button Is Pressed
App Widgets
Recipe: Creating an App Widget
Recipe: Creating an App Widget
Alerts
Recipe: Using Toast to Show a Brief Message on the Screen
Recipe: Using an Alert Dialog Box
Recipe: Showing Notification in Status Bar
Recipe: Using Toast to Show a Brief Message on the Screen
Recipe: Using an Alert Dialog Box
Recipe: Showing Notification in Status Bar
4 User Interface Layout
Resource Directories and General Attributes
Recipe: Specifying Alternate Resources
Recipe: Specifying Alternate Resources
Views and ViewGroups
Recipe: Building Layouts in the Eclipse Editor
Recipe: Controlling the Width and Height of UI Elements
Recipe: Setting Relative Layout and Layout ID
Recipe: Declaring a Layout Programmatically
Recipe: Updating a Layout from a Separate Thread
Recipe: Building Layouts in the Eclipse Editor
Recipe: Controlling the Width and Height of UI Elements
Recipe: Setting Relative Layout and Layout ID
Recipe: Declaring a Layout Programmatically
Recipe: Updating a Layout from a Separate Thread
Text Manipulation
Recipe: Setting and Changing Text Attributes
Recipe: Providing Text Entry
Recipe: Creating a Form
Recipe: Setting and Changing Text Attributes
Recipe: Providing Text Entry
Recipe: Creating a Form
Other Widgets: From Buttons to Seek Bars
Recipe: Using Image Buttons in a Table Layout
Recipe: Using Check Boxes and Toggle Buttons
Recipe: Using Radio Buttons
Recipe: Creating a Drop-Down Menu
Recipe: Using a Progress Bar
Recipe: Using a SeekBar
Recipe: Using Image Buttons in a Table Layout
Recipe: Using Check Boxes and Toggle Buttons
Recipe: Using Radio Buttons
Recipe: Creating a Drop-Down Menu
Recipe: Using a Progress Bar
Recipe: Using a SeekBar
Resource Directories and General Attributes
Recipe: Specifying Alternate Resources
Recipe: Specifying Alternate Resources
Views and ViewGroups
Recipe: Building Layouts in the Eclipse Editor
Recipe: Controlling the Width and Height of UI Elements
Recipe: Setting Relative Layout and Layout ID
Recipe: Declaring a Layout Programmatically
Recipe: Updating a Layout from a Separate Thread
Recipe: Building Layouts in the Eclipse Editor
Recipe: Controlling the Width and Height of UI Elements
Recipe: Setting Relative Layout and Layout ID
Recipe: Declaring a Layout Programmatically
Recipe: Updating a Layout from a Separate Thread
Text Manipulation
Recipe: Setting and Changing Text Attributes
Recipe: Providing Text Entry
Recipe: Creating a Form
Recipe: Setting and Changing Text Attributes
Recipe: Providing Text Entry
Recipe: Creating a Form
Other Widgets: From Buttons to Seek Bars
Recipe: Using Image Buttons in a Table Layout
Recipe: Using Check Boxes and Toggle Buttons
Recipe: Using Radio Buttons
Recipe: Creating a Drop-Down Menu
Recipe: Using a Progress Bar
Recipe: Using a SeekBar
Recipe: Using Image Buttons in a Table Layout
Recipe: Using Check Boxes and Toggle Buttons
Recipe: Using Radio Buttons
Recipe: Creating a Drop-Down Menu
Recipe: Using a Progress Bar
Recipe: Using a SeekBar
5 User Interface Events
Event Handlers and Event Listeners
Recipe: Intercepting a Physical Key Press
Recipe: Building Menus
Recipe: Defining Menus in XML
Recipe: Utilizing the SEARCH Key
Recipe: Reacting to Touch Events
Recipe: Listening for Fling Gestures
Recipe: Using Multitouch
Recipe: Intercepting a Physical Key Press
Recipe: Building Menus
Recipe: Defining Menus in XML
Recipe: Utilizing the SEARCH Key
Recipe: Reacting to Touch Events
Recipe: Listening for Fling Gestures
Recipe: Using Multitouch
Advanced User Interface Libraries
Recipe: Using Gestures
Recipe: Drawing 3D Images
Recipe: Using Gestures
Recipe: Drawing 3D Images
Event Handlers and Event Listeners
Recipe: Intercepting a Physical Key Press
Recipe: Building Menus
Recipe: Defining Menus in XML
Recipe: Utilizing the SEARCH Key
Recipe: Reacting to Touch Events
Recipe: Listening for Fling Gestures
Recipe: Using Multitouch
Recipe: Intercepting a Physical Key Press
Recipe: Building Menus
Recipe: Defining Menus in XML
Recipe: Utilizing the SEARCH Key
Recipe: Reacting to Touch Events
Recipe: Listening for Fling Gestures
Recipe: Using Multitouch
Advanced User Interface Libraries
Recipe: Using Gestures
Recipe: Drawing 3D Images
Recipe: Using Gestures
Recipe: Drawing 3D Images
6 Multimedia Techniques
Images
Recipe: Loading an Image for Manipulation
Recipe: Loading an Image for Manipulation
Audio
Recipe: Choosing and Playing Back Audio Files
Recipe: Recording Audio Files
Recipe: Manipulating Raw Audio
Recipe: Using Sound Resources Efficiently
Recipe: Adding Media and Updating Paths
Recipe: Choosing and Playing Back Audio Files
Recipe: Recording Audio Files
Recipe: Manipulating Raw Audio
Recipe: Using Sound Resources Efficiently
Recipe: Adding Media and Updating Paths
Video
Images
Recipe: Loading an Image for Manipulation
Recipe: Loading an Image for Manipulation
Audio
Recipe: Choosing and Playing Back Audio Files
Recipe: Recording Audio Files
Recipe: Manipulating Raw Audio
Recipe: Using Sound Resources Efficiently
Recipe: Adding Media and Updating Paths
Recipe: Choosing and Playing Back Audio Files
Recipe: Recording Audio Files
Recipe: Manipulating Raw Audio
Recipe: Using Sound Resources Efficiently
Recipe: Adding Media and Updating Paths
Video
7 Hardware Interface
Camera
Recipe: Customizing the Camera
Recipe: Customizing the Camera
Other Sensors
Recipe: Getting a Device’s Rotational Attitude
Recipe: Using the Temperature and Light Sensor
Recipe: Getting a Device’s Rotational Attitude
Recipe: Using the Temperature and Light Sensor
Telephony
Recipe: Utilizing the Telephony Manager
Recipe: Listening for Phone States
Recipe: Dialing a Phone Number
Recipe: Utilizing the Telephony Manager
Recipe: Listening for Phone States
Recipe: Dialing a Phone Number
Bluetooth
Recipe: Turning on Bluetooth
Recipe: Discovering Bluetooth Devices
Recipe: Pairing with Bonded Bluetooth Devices
Recipe: Opening a Bluetooth Socket
Recipe: Using Device Vibration
Recipe: Accessing the Wireless Network
Recipe: Turning on Bluetooth
Recipe: Discovering Bluetooth Devices
Recipe: Pairing with Bonded Bluetooth Devices
Recipe: Opening a Bluetooth Socket
Recipe: Using Device Vibration
Recipe: Accessing the Wireless Network
Camera
Recipe: Customizing the Camera
Recipe: Customizing the Camera
Other Sensors
Recipe: Getting a Device’s Rotational Attitude
Recipe: Using the Temperature and Light Sensor
Recipe: Getting a Device’s Rotational Attitude
Recipe: Using the Temperature and Light Sensor
Telephony
Recipe: Utilizing the Telephony Manager
Recipe: Listening for Phone States
Recipe: Dialing a Phone Number
Recipe: Utilizing the Telephony Manager
Recipe: Listening for Phone States
Recipe: Dialing a Phone Number
Bluetooth
Recipe: Turning on Bluetooth
Recipe: Discovering Bluetooth Devices
Recipe: Pairing with Bonded Bluetooth Devices
Recipe: Opening a Bluetooth Socket
Recipe: Using Device Vibration
Recipe: Accessing the Wireless Network
Recipe: Turning on Bluetooth
Recipe: Discovering Bluetooth Devices
Recipe: Pairing with Bonded Bluetooth Devices
Recipe: Opening a Bluetooth Socket
Recipe: Using Device Vibration
Recipe: Accessing the Wireless Network
8 Networking
Using SMS
Recipe: Autosend an SMS Based on a Received SMS
Recipe: Autosend an SMS Based on a Received SMS
Using Web Content
Recipe: Customizing a Web Browser
Recipe: Using an HTTP GET
Recipe: Using HTTP POST
Recipe: Customizing a Web Browser
Recipe: Using an HTTP GET
Recipe: Using HTTP POST
Social Networking
Recipe: Integrating with Twitter
Recipe: Integrating with Twitter
Using SMS
Recipe: Autosend an SMS Based on a Received SMS
Recipe: Autosend an SMS Based on a Received SMS
Using Web Content
Recipe: Customizing a Web Browser
Recipe: Using an HTTP GET
Recipe: Using HTTP POST
Recipe: Customizing a Web Browser
Recipe: Using an HTTP GET
Recipe: Using HTTP POST
Social Networking
Recipe: Integrating with Twitter
Recipe: Integrating with Twitter
9 Data Storage Methods
Shared Preferences
Recipe: Creating and Retrieving Shared Preferences
Recipe: Using the Preferences Framework
Recipe: Changing the UI Based on Stored Data
Recipe: Adding a EULA
Recipe: Creating and Retrieving Shared Preferences
Recipe: Using the Preferences Framework
Recipe: Changing the UI Based on Stored Data
Recipe: Adding a EULA
SQLite Database
Recipe: Creating a Separate Database Package
Recipe: Using a Separate Database Package
Recipe: Creating a Personal Diary
Recipe: Creating a Separate Database Package
Recipe: Using a Separate Database Package
Recipe: Creating a Personal Diary
Content Provider
Recipe: Creating a Custom Content Provider
Recipe: Creating a Custom Content Provider
File Saving and Loading
Shared Preferences
Recipe: Creating and Retrieving Shared Preferences
Recipe: Using the Preferences Framework
Recipe: Changing the UI Based on Stored Data
Recipe: Adding a EULA
Recipe: Creating and Retrieving Shared Preferences
Recipe: Using the Preferences Framework
Recipe: Changing the UI Based on Stored Data
Recipe: Adding a EULA
SQLite Database
Recipe: Creating a Separate Database Package
Recipe: Using a Separate Database Package
Recipe: Creating a Personal Diary
Recipe: Creating a Separate Database Package
Recipe: Using a Separate Database Package
Recipe: Creating a Personal Diary
Content Provider
Recipe: Creating a Custom Content Provider
Recipe: Creating a Custom Content Provider
File Saving and Loading
10 Location-Based Services
Location Basics
Recipe: Retrieving Last Location
Recipe: Updating Location Upon Change
Recipe: Listing All Enabled Providers
Recipe: Translating a Location to Address (Reverse Geocoding)
Recipe: Translating an Address to Location (Geocoding)
Recipe: Retrieving Last Location
Recipe: Updating Location Upon Change
Recipe: Listing All Enabled Providers
Recipe: Translating a Location to Address (Reverse Geocoding)
Recipe: Translating an Address to Location (Geocoding)
Using Google Maps
Recipe: Adding Google Maps to an Application
Recipe: Adding Markers on a Map
Recipe: Adding Views to a Map
Recipe: Marking the Device’s Current Location on a Map
Recipe: Setting up a Proximity Alert
Recipe: Adding Google Maps to an Application
Recipe: Adding Markers on a Map
Recipe: Adding Views to a Map
Recipe: Marking the Device’s Current Location on a Map
Recipe: Setting up a Proximity Alert
Location Basics
Recipe: Retrieving Last Location
Recipe: Updating Location Upon Change
Recipe: Listing All Enabled Providers
Recipe: Translating a Location to Address (Reverse Geocoding)
Recipe: Translating an Address to Location (Geocoding)
Recipe: Retrieving Last Location
Recipe: Updating Location Upon Change
Recipe: Listing All Enabled Providers
Recipe: Translating a Location to Address (Reverse Geocoding)
Recipe: Translating an Address to Location (Geocoding)
Using Google Maps
Recipe: Adding Google Maps to an Application
Recipe: Adding Markers on a Map
Recipe: Adding Views to a Map
Recipe: Marking the Device’s Current Location on a Map
Recipe: Setting up a Proximity Alert
Recipe: Adding Google Maps to an Application
Recipe: Adding Markers on a Map
Recipe: Adding Views to a Map
Recipe: Marking the Device’s Current Location on a Map
Recipe: Setting up a Proximity Alert
11 Advanced Android Development
Android Custom View
Recipe: Customizing a Button
Recipe: Customizing a Button
Android Native Components
Recipe: Developing a Native Component
Recipe: Developing a Native Component
Android Security
Recipe: Declaring and Enforcing Permissions
Recipe: Declaring and Enforcing Permissions
Android Inter-Process Communication
Recipe: Implementing a Remote Procedure Call
Recipe: Implementing a Remote Procedure Call
Android Backup Manager
Recipe: Creating a Backup of Runtime Data
Recipe: Backing Up Files to the Cloud
Recipe: Triggering Backup and Restore
Recipe: Creating a Backup of Runtime Data
Recipe: Backing Up Files to the Cloud
Recipe: Triggering Backup and Restore
Android Animation
Recipe: Creating an Animation
Recipe: Creating an Animation
Android Custom View
Recipe: Customizing a Button
Recipe: Customizing a Button
Android Native Components
Recipe: Developing a Native Component
Recipe: Developing a Native Component
Android Security
Recipe: Declaring and Enforcing Permissions
Recipe: Declaring and Enforcing Permissions
Android Inter-Process Communication
Recipe: Implementing a Remote Procedure Call
Recipe: Implementing a Remote Procedure Call
Android Backup Manager
Recipe: Creating a Backup of Runtime Data
Recipe: Backing Up Files to the Cloud
Recipe: Triggering Backup and Restore
Recipe: Creating a Backup of Runtime Data
Recipe: Backing Up Files to the Cloud
Recipe: Triggering Backup and Restore
Android Animation
Recipe: Creating an Animation
Recipe: Creating an Animation
12 Debugging
Eclipse Built-in Debug Tools
Recipe: Specifying a Run Configuration
Recipe: Using the DDMS
Recipe: Debugging Through Breakpoints
Recipe: Specifying a Run Configuration
Recipe: Using the DDMS
Recipe: Debugging Through Breakpoints
Android SDK Debug Tools
Recipe: Using the Android Debug Bridge
Recipe: Using LogCat
Recipe: Using the Hierarchy Viewer
Recipe: Using TraceView
Recipe: Using the Android Debug Bridge
Recipe: Using LogCat
Recipe: Using the Hierarchy Viewer
Recipe: Using TraceView
Android System Debug Tools
Recipe: Setting up GDB Debugging
Recipe: Setting up GDB Debugging
Eclipse Built-in Debug Tools
Recipe: Specifying a Run Configuration
Recipe: Using the DDMS
Recipe: Debugging Through Breakpoints
Recipe: Specifying a Run Configuration
Recipe: Using the DDMS
Recipe: Debugging Through Breakpoints
Android SDK Debug Tools
Recipe: Using the Android Debug Bridge
Recipe: Using LogCat
Recipe: Using the Hierarchy Viewer
Recipe: Using TraceView
Recipe: Using the Android Debug Bridge
Recipe: Using LogCat
Recipe: Using the Hierarchy Viewer
Recipe: Using TraceView
Android System Debug Tools
Recipe: Setting up GDB Debugging
Recipe: Setting up GDB Debugging
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q-R
S
T
U
V
W
X-Y-Z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q-R
S
T
U
V
W
X-Y-Z
← Prev
Back
Next →
← Prev
Back
Next →