You are previewing Android Application Development Cookbook: 93 Recipes for Building Winning Apps.
O'Reilly logo
Android Application Development Cookbook: 93 Recipes for Building Winning Apps

Book Description

A must-have collection of ready-to-use Android recipes!

The popularity of Google Android devices is seemingly unstoppable and the Android 4 release offers, for the first time, a single OS solution for building both phone and tablet applications. With that exciting information in mind, veteran author Wei-Meng Lee presents you with 100 unique recipes that you can apply today in order to discover solutions to some of the most commonly encountered problems that exist in Android programming.

Covering the scope of multiple Android releases up through Android 4, this reference features a task description, followed by the solution(s) available, and a standalone project file that illustrates the use of the recipe. Formatting each recipe to be standalone, Wei-Meng Lee allows you to jump into the relevant recipe to find a solution to specific challenges.

  • Identifies and describes a programming task, provides a step-by-step solution, and presents a full-code solution ready for download

  • Covers multiple Android releases

  • Addresses such topics as user interfaces, telephony and messaging, networking, Google maps, location-based services, persisting data, leveraging hardware features, and more

Android Application Development Cookbook is your solution to discovering...solutions!

Table of Contents

  1. Cover
  2. Chapter 1: Android Fundamentals
    1. Recipe 1.1 Linking Activities
    2. Recipe 1.2 Passing Data Between Activities
    3. Recipe 1.3 Passing Objects Between Activities
    4. Recipe 1.4 Sending and Receiving Broadcasts
    5. Recipe 1.5 Assigning Priorities to Broadcast Receivers
    6. Recipe 1.6 Auto-Launching Your Application at Boot Time
    7. Recipe 1.7 Calling Built-In Apps
  3. Chapter 2: Using Views to Design the User Interface
    1. Recipe 2.1 Using Buttons
    2. Recipe 2.2 Using Image Buttons
    3. Recipe 2.3 Using Radio Buttons
    4. Recipe 2.4 Using CheckBoxes
    5. Recipe 2.5 Implementing a Star Rating System
    6. Recipe 2.6 Using AutoCompleteTextView
    7. Recipe 2.7 Displaying Web Pages
    8. Recipe 2.8 Using the TimePicker
    9. Recipe 2.9 Using the DatePicker
    10. Recipe 2.10 Using LinearLayout for View Positioning
    11. Recipe 2.11 Using RelativeLayout for View Positioning
    12. Recipe 2.12 Using FrameLayout for View Positioning
    13. Recipe 2.13 Using TableLayout for View Positioning
    14. Recipe 2.14 Using the ScrollView
    15. Recipe 2.15 Displaying Context and Options Menus
    16. Recipe 2.16 Displaying Dialogs
  4. Chapter 3: Displaying Lists of Items and Images
    1. Recipe 3.1 Displaying a List of Items Using the ListView
    2. Recipe 3.2 Customizing the ListView
    3. Recipe 3.3 Displaying Multiple ListViews
    4. Recipe 3.4 Creating Custom ListViews
    5. Recipe 3.5 Further Customizing Each Row with Additional TextViews
    6. Recipe 3.6 Displaying a List of Items Using the Spinner View
    7. Recipe 3.7 Displaying a List of Images
    8. Recipe 3.8 Animating the Changing of Images Using the ImageSwitcher
    9. Recipe 3.9 Displaying Images Using the GridView
  5. Chapter 4: Telephony
    1. Recipe 4.1 Calling from Your Application
    2. Recipe 4.2 Monitoring the State of the Phone
    3. Recipe 4.3 Monitoring Phone State in the Background
    4. Recipe 4.4 Blocking Outgoing Calls
    5. Recipe 4.5 Auto-Answering an Incoming Call
    6. Recipe 4.6 Switching to Airplane Mode
    7. Recipe 4.7 Getting the Phone Number, IMEI, and SIM Card ID
    8. Recipe 4.8 Enabling Bluetooth
  6. Chapter 5: Messaging
    1. Recipe 5.1 Sending SMS Messages Through the Built-in Messaging Application
    2. Recipe 5.2 Sending SMS Messages Programmatically in Your Android Application
    3. Recipe 5.3 Monitoring the Status of Sent SMS Messages Programmatically
    4. Recipe 5.4 Monitoring Outgoing SMS Messages
  7. Chapter 6: Network Programming
    1. Recipe 6.1 Connecting to Servers Using HTTP GET
    2. Recipe 6.2 Connecting to Servers Using HTTP POST
    3. Recipe 6.3 Downloading Binary Data Using HTTP
    4. Recipe 6.4 Consuming XML Web Services
    5. Recipe 6.5 Consuming JSON Web Services
    6. Recipe 6.6 Getting the IP Address of the Device
    7. Recipe 6.7 Creating a Socket Server
    8. Recipe 6.8 Creating a Socket Client
    9. Recipe 6.9 Checking for the Availability of Bluetooth
    10. Recipe 6.10 Monitoring the State of Bluetooth
  8. Chapter 7: Using Google Maps
    1. Recipe 7.1 Displaying Google Maps
    2. Recipe 7.2 Zooming in and out of Google Maps
    3. Recipe 7.3 Changing Map Modes
    4. Recipe 7.4 Navigating the Map to a Particular Location
    5. Recipe 7.5 Adding Markers to the Map
    6. Recipe 7.6 Finding a User-Friendly Address Using Reverse Geocoding, and Vice Versa
  9. Chapter 8: Location-Based Data Services
    1. Recipe 8.1 Obtaining Geographical Location Using GPS, Wi-Fi, or Cellular Networks
    2. Recipe 8.2 Choosing the Best Location Provider to Use
    3. Recipe 8.3 Monitoring a Location
    4. Recipe 8.4 Using a BroadcastReceiver to Obtain Locations
  10. Chapter 9: Accessing the Hardware
    1. Recipe 9.1 Capturing Pictures with the Camera
    2. Recipe 9.2 Detecting the Presence of Hardware Features
    3. Recipe 9.3 Checking Network State
    4. Recipe 9.4 Turning GPS On/Off
    5. Recipe 9.5 Capturing Hardware Buttons Programmatically
    6. Recipe 9.6 Switching on the Flashlight
  11. Chapter 10: Persisting Data
    1. Recipe 10.1 Saving and Loading User Preferences
    2. Recipe 10.2 Creating a Preference Screen
    3. Recipe 10.3 Saving Files to the Data Directory
    4. Recipe 10.4 Saving Files to the Cache Directory
    5. Recipe 10.5 Saving Files to External Storage
    6. Recipe 10.6 Attaching Files to Your Project
    7. Recipe 10.7 Creating and Using SQLite Databases Programmatically
  12. Chapter 11: Deploying Your Android Applications
    1. Recipe 11.1 Localizing Your Application
    2. Recipe 11.2 Exporting Your Application as an APK File
    3. Recipe 11.3 Deploying Your App Through E-mail
    4. Recipe 11.4 Deploying Your App Through the Web
    5. Recipe 11.5 Deploying Your App Through an SD Card
  13. Introduction
  14. Advertisements