Szczegóły ebooka

Asynchronous Android. As an Android developer you know you're in a competitive marketplace. This book can give you the edge by guiding you through the concurrency constructs and proper use of AsyncTask to create smooth user interfaces

Asynchronous Android. As an Android developer you know you're in a competitive marketplace. This book can give you the edge by guiding you through the concurrency constructs and proper use of AsyncTask to create smooth user interfaces

Steve Liles

Ebook
With more than a million apps available from Google Play, it is more important than ever to build apps that stand out from the crowd. To be successful, apps must react quickly to user input, deliver results in a flash, and sync data in the background. The key to this is understanding the right way to implement asynchronous operations that work with the platform, instead of against it. Asynchronous Android is a practical book that guides you through the concurrency constructs provided by the Android platform, illustrating the applications, benefits, and pitfalls of each.Learn to use AsyncTask correctly to perform operations in the background, keeping user-interfaces running smoothly while avoiding treacherous memory leaks. Discover Handler, HandlerThread and Looper, the related and fundamental building blocks of asynchronous programming in Android. Escape from the constraints of the Activity lifecycle to load and cache data efficiently across your entire application with the Loader framework. Keep your data fresh with scheduled tasks, and understand how Services let your application continue to run in the background, even when the user is busy with something else.Asynchronous Android will help you to build well-behaved apps with smooth, responsive user-interfaces that delight users with speedy results and data that's always fresh, and keep the system happy and the battery charged by playing by the rules.
  • Asynchronous Android
    • Table of Contents
    • Asynchronous Android
    • Credits
    • About the Author
    • About the Reviewers
    • www.PacktPub.com
      • Support files, eBooks, discount offers and more
        • Why Subscribe?
        • Free Access for Packt account holders
    • Preface
      • What this book covers
      • What you need for this book
      • Who this book is for
      • Conventions
      • Reader feedback
      • Customer support
        • Downloading the example code
        • Errata
        • Piracy
        • Questions
    • 1. Building Responsive Android Applications
      • Introducing the Dalvik Virtual Machine
        • Memory sharing and the Zygote
      • Understanding the Android thread model
        • The main thread
        • Unresponsive apps and the ANR dialog
        • Maintaining responsiveness
        • Concurrency in Android
          • Correctness issues in concurrent programs
          • Liveness issues in concurrent programs
          • Android-specific concurrency issues
            • The Activity lifecycle
            • Manipulating the user interface
        • Android-specific concurrency constructs
      • Summary
    • 2. Staying Responsive with AsyncTask
      • Introducing AsyncTask
      • Declaring AsyncTask types
      • Executing AsyncTasks
      • Providing feedback to the user
        • Providing progress updates
      • Canceling AsyncTask
      • Handling exceptions
      • Controlling the level of concurrency
      • Common AsyncTask issues
        • Fragmentation issues
        • Activity lifecycle issues
          • Handling lifecycle issues with early cancellation
          • Handling lifecycle issues with retained headless fragments
      • Applications of AsyncTask
      • Summary
    • 3. Distributing Work with Handler and HandlerThread
      • Understanding Looper
      • Building responsive apps with Handler
        • Scheduling work with post
          • Canceling a pending Runnable
        • Scheduling work with send
          • Canceling pending Messages
          • Composition versus Inheritance
          • Multithreaded example
        • Sending Messages versus posting Runnables
        • Building responsive apps with HandlerThread
      • Handler programming issues
        • Leaking implicit references
        • Leaking explicit references
      • Applications of Handler and HandlerThread
      • Summary
    • 4. Asynchronous I/O with Loader
      • Introducing Loaders
      • Building responsive apps with AsyncTaskLoader
      • Building responsive apps with CursorLoader
      • Combining Loaders
      • Applications of Loaders
      • Summary
    • 5. Queuing Work with IntentService
      • Introducing Service and IntentService
      • Building responsive apps with IntentService
        • Handling results
          • Returning results with PendingIntent
          • Posting results as system notifications
      • Applications of IntentService
        • HTTP uploads with IntentService
        • Reporting progress
      • Summary
    • 6. Long-running Tasks with Service
      • Building responsive apps with Service
        • Controlling concurrency with Executors
        • Returning results with Messenger
      • Communicating with Services
        • Direct communication with local Services
        • Broadcasting results with Intents
        • Detecting unhandled broadcasts
      • Applications of Services
      • Summary
    • 7. Scheduling Work with AlarmManager
      • Scheduling alarms with AlarmManager
        • Canceling alarms
        • Scheduling repeating alarms
      • Handling alarms
        • Handling alarms with Activities
        • Handling alarms with BroadcastReceiver
          • Doing work with BroadcastReceiver
          • Doing background work with goAsync
        • Handling alarms with Services
      • Staying awake with WakeLocks
      • Applications of AlarmManager
      • Summary
    • Index
  • Tytuł: Asynchronous Android. As an Android developer you know you're in a competitive marketplace. This book can give you the edge by guiding you through the concurrency constructs and proper use of AsyncTask to create smooth user interfaces
  • Autor: Steve Liles
  • Tytuł oryginału: Asynchronous Android. As an Android developer you know you're in a competitive marketplace. This book can give you the edge by guiding you through the concurrency constructs and proper use of AsyncTask to create smooth user interfaces.
  • ISBN: 9781783286881, 9781783286881
  • Data wydania: 2013-12-24
  • Format: Ebook
  • Identyfikator pozycji: e_3ati
  • Wydawca: Packt Publishing