You are previewing Pro Android 4.
O'Reilly logo
Pro Android 4

Book Description

Pro Android 4shows you how to build real-world and fun mobile apps using the new Android SDK 4 (Ice Cream Sandwich), which unifies Gingerbread for smartphones, Honeycomb for tablets and augments further with Google TV and more.

This Android 4 book updates the best selling Pro Android 3 and covers everything from the fundamentals of building apps for embedded devices, smartphones, and tablets to advanced concepts such as custom 3D components, multi-tasking, sensors/augmented reality, better accessories support and much more.

  • Using the tutorials and expert advice, you'll quickly be able to build cool mobile apps and run them on dozens of Android-based smartphones.

  • You'll explore and use the Android APIs, including those for media and sensors.

  • And you'll check out what's new with Android 4, including the improved user interface across all Android platforms, integration with services, and more.

After reading this definitive tutorial and reference, you gain the knowledge and experience to create stunning, cutting-edge Android 4 apps that can make you money, while keeping you agile enough to respond to changes in the future.

What you'll learn

  • How to use Android 4 to build Java-based mobile apps for Android smartphones and tablets

  • How to build irresistible standard and custom User Interfaces and User Experiences (UI and UX) across Android devices

  • How to populate your application with data from data sources, using Content Providers

  • How to create 3D graphics with OpenGL and custom components

  • How to build multimedia and game apps using Android's media APIs and OpenGL

  • How to use Android's location-based services, network-based services, and security

  • How to use new Android features, such as Fragments and the ActionBar

Who this book is for

This book is for professional software engineers and programmers looking to move their ideas and applications into the mobile space with Android. It assumes a passable understanding of Java, including how to write classes and handle basic inheritance structures.

Table of Contents

  1. Title
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Authors
  6. About the Technical Reviewers
  7. Acknowledgments
  8. Preface
  9. Chapter 1: Introducing the Android Computing Platform
    1. A New Platform for a New Personal Computer
    2. Early History of Android
    3. Delving Into the Dalvik VM
    4. Understanding the Android Software Stack
    5. Developing an End-User Application with the Android SDK
    6. Taking Advantage of Android Source Code
    7. The Sample Projects in this Book
    8. Summary
  10. Chapter 2: Setting up your Development Environment
    1. Setting Up Your Environment
    2. Learning the Fundamental Components
    3. Hello World
    4. Android Virtual Devices
    5. Running on a Real Device
    6. Exploring the Structure of an Android Application
    7. Examining the Application Life Cycle
    8. Simple Debugging
    9. References
    10. Summary
    11. Interview Questions
  11. Chapter 3: Understanding Android Resources
    1. Understanding Resources
    2. Enumerating Key Android Resources
    3. Working with Arbitrary XML Resource Files
    4. Working with Raw Resources
    5. Working with Assets
    6. Reviewing the Resources Directory Structure
    7. Resources and Configuration Changes
    8. Reference URLs
    9. Summary
    10. Interview Questions
  12. Chapter 4: Understanding Content Providers
    1. Exploring Android’s Built-in Providers
    2. Architecture of Content Providers
    3. Implementing Content Providers
    4. Exercising the Book Provider
    5. Resources
    6. Summary
    7. Interview Questions
  13. Chapter 5: Understanding Intents
    1. Basics of Android Intents
    2. Available Intents in Android
    3. Exploring Intent Composition
    4. Exercising the ACTION_PICK
    5. Exercising the GET_CONTENT Action
    6. Introducing Pending Intents
    7. Resources
    8. Summary
    9. Interview Questions
  14. Chapter 6: Building User Interfaces and Using Controls
    1. UI Development in Android
    2. Understanding Android's Common Controls
    3. Understanding Adapters
    4. Using Adapters with AdapterViews
    5. Styles and Themes
    6. Understanding Layout Managers
    7. References
    8. Summary
    9. Interview Questions
  15. Chapter 7: working with menus
    1. Understanding Android Menus
    2. Working with Other Menu Types
    3. Loading Menus Through XML Files
    4. Resources
    5. Summary
    6. Interview Questions
  16. Chapter 8: Fragments for Tablets and More
    1. What Is a Fragment?
    2. FragmentTransactions and the Fragment Back Stack
    3. The FragmentManager
    4. Communications with Fragments
    5. Custom Animations with ObjectAnimator
    6. References
    7. Summary
    8. Interview Questions
  17. Chapter 9: Working with Dialogs
    1. Using Dialogs in Android
    2. Understanding Dialog Fragments
    3. Working with Toast
    4. Dialog Fragments for Older Android
    5. References
    6. Summary
    7. Interview Questions
  18. Chapter 10: Exploring ActionBar
    1. Anatomy of an ActionBar
    2. Tabbed Navigation Action Bar Activity
    3. List Navigation Action Bar Activity
    4. Standard Navigation Action Bar Activity
    5. Action Bar and Search View
    6. The Action Bar and Fragments
    7. References
    8. Summary
    9. Interview Questions
  19. Chapter 11: Advanced Debugging and Analysis
    1. Enabling Advanced Debugging
    2. The Debug Perspective
    3. The DDMS Perspective
    4. The Hierarchy View Perspective
    5. Traceview
    6. The adb Command
    7. The Emulator Console
    8. StrictMode
    9. References
    10. Summary
    11. Interview Questions
  20. Chapter 12: Responding to Configuration Changes
    1. The Configuration Change Process
    2. Deprecated Configuration Change Methods
    3. References
    4. Summary
    5. Interview Questions
  21. Chapter 13: Working with Preferences and Saving State
    1. Exploring the Preferences Framework
    2. Organizing Preferences
    3. Manipulating Preferences Programmatically
    4. Reference
    5. Summary
    6. Interview Questions
  22. Chapter 14: Exploring Security and Permissions
    1. Understanding the Android Security Model
    2. Performing Runtime Security Checks
    3. References
    4. Summary
    5. Interview Questions
  23. Chapter 15: Building and Consuming Services
    1. Consuming HTTP Services
    2. Using Android Services
    3. References
    4. Summary
    5. Interview Questions
  24. Chapter 16: Exploring Packages
    1. Packages and Processes
    2. Revisiting the Package Signing Process
    3. Sharing Data Among Packages
    4. Library Projects
    5. References
    6. Summary
    7. Interview Questions
  25. Chapter 17: Exploring Handlers
    1. Android Components and Threading
    2. Handlers
    3. Using Worker Threads
    4. Component and Process Lifetimes
    5. References
    6. Summary
    7. Interview Questions
  26. Chapter 18: Exploring the AsyncTask
    1. Implementing a simple AsyncTask
    2. Nature of an Async Task
    3. Device Rotation and AsyncTask
    4. Life Cycle Methods and AsyncTask
    5. References
    6. Summary
    7. Interview Questions
  27. Chapter 19: Broadcast Receivers and Long-Running Services
    1. Broadcast Receivers
    2. Using Notifications from a Receiver
    3. Long-Running Receivers and Services
    4. Extending IntentService for a Broadcast Receiver
    5. Long-Running Service Implementation
    6. A Few Notes about the Project Download File
    7. References
    8. Summary
    9. Interview Questions
  28. Chapter 20: Exploring the Alarm Manager
    1. Alarm Manager Basics: Setting Up a Simple Alarm
    2. Exploring Alarm Manager Alternate Scenarios
    3. Alarm Manager Predicates
    4. References
    5. Summary
    6. Interview Questions
  29. Chapter 21: Exploring 2D Animation
    1. Frame-by-Frame Animation
    2. Layout Animation
    3. View Animation
    4. Property Animations: The New Animation API
    5. Resources
    6. Summary
    7. Interview Questions
  30. Chapter 22: Exploring Maps and Location-based Services
    1. Understanding the Mapping Package
    2. Understanding the Location Package
    3. References
    4. Summary
    5. Interview Questions
  31. Chapter 23: Using the Telephony APIs
    1. Working with SMS
    2. Working with the Telephony Manager
    3. Session Initiation Protocol (SIP)
    4. References
    5. Summary
    6. Interview Questions
  32. Chapter 24: Understanding the Media Frameworks
    1. Using the Media APIs
    2. Playing Media
    3. Recording Media
    4. Summary
    5. Interview Questions
  33. Chapter 25: Home Screen Widgets
    1. Architecture of Home Screen Widgets
    2. A Sample Widget Application
    3. Widget Preview Tool
    4. Widget Limitations and Extensions
    5. Collection-Based Widgets
    6. Resources
    7. Summary
    8. Interview Questions
  34. Chapter 26: Exploring List Widgets
    1. A Quick Note on Remote Views
    2. Working with Lists in Remote Views
    3. Working Sample: Test Home Screen List Widget
    4. Testing the Test List Widget
    5. References
    6. Summary
    7. Interview Questions
  35. Chapter 27: Touch Screens
    1. Understanding MotionEvents
    2. Multitouch
    3. Touches with Maps
    4. Gestures
    5. References
    6. Summary
    7. Interview Questions
  36. Chapter 28: Implementing Drag and Drop
    1. Exploring Drag and Drop
    2. Basics of Drag and Drop in 3.0+
    3. Drag-and-Drop Example Application
    4. Testing the Example Drag-and-Drop Application
    5. References
    6. Summary
    7. Interview Questions
  37. Chapter 29: Using Sensors
    1. What Is a Sensor?
    2. Getting Sensor Events
    3. Interpreting Sensor Data
    4. References
    5. Summary
    6. Interview Questions
  38. Chapter 30: Exploring the Contacts API
    1. Understanding Accounts
    2. Understanding the Contacts Application
    3. Understanding Contacts
    4. Working with the Contacts API
    5. Controlling Aggregation
    6. Impacts of Syncing
    7. Understanding the Personal Profile
    8. References
    9. Summary
    10. Interview Questions
  39. Chapter 31: Deploying Your Application: Android Market and Beyond
    1. Becoming a Publisher
    2. Preparing Your Application for Sale
    3. Uploading Your Application
    4. User Experience on Android Market
    5. Beyond Android Market
    6. References
    7. Summary
    8. Interview Questions
  40. Index