Book description
Multithreading is essential if you want to create an Android app with a great user experience, but how do you know which techniques can help solve your problem? This practical book describes many asynchronous mechanisms available in the Android SDK, and provides guidelines for selecting the ones most appropriate for the app you’re building.
Author Anders Goransson demonstrates the advantages and disadvantages of each technique, with sample code and detailed explanations for using it efficiently. The first part of the book describes the building blocks of asynchronous processing, and the second part covers Android libraries and constructs for developing fast, responsive, and well-structured apps.
- Understand multithreading basics in Java and on the Android platform
- Learn how threads communicate within and between processes
- Use strategies to reduce the risk of memory leaks
- Manage the lifecycle of a basic thread
- Run tasks sequentially in the background with HandlerThread
- Use Java’s Executor Framework to control or cancel threads
- Handle background task execution with AsyncTask and IntentService
- Access content providers with AsyncQueryHandler
- Use loaders to update the UI with new data
Table of contents
- Dedication
- Preface
- 1. Android Components and the Need for Multiprocessing
-
I. Fundamentals
- 2. Multithreading in Java
- 3. Threads on Android
- 4. Thread Communication
- 5. Interprocess Communication
- 6. Memory Management
-
II. Asynchronous Techniques
- 7. Managing the Lifecycle of a Basic Thread
- 8. HandlerThread: A High-Level Queueing Mechanism
- 9. Control over Thread Execution Through the Executor Framework
- 10. Tying a Background Task to the UI Thread with AsyncTask
- 11. Services
- 12. IntentService
- 13. Access ContentProviders with AsyncQueryHandler
- 14. Automatic Background Execution with Loaders
- 15. Summary: Selecting an Asynchronous Technique
- A. Bibliography
- Index
- Colophon
- Copyright
Product information
- Title: Efficient Android Threading
- Author(s):
- Release date: May 2014
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449364090
You might also like
book
Android High Performance Programming
Build fast and efficient Android apps that run as reliably as clockwork in a multi-device world …
book
Android on x86: An Introduction to Optimizing for Intel® Architecture
Android on x86: an Introduction to Optimizing for Intel® Architecture serves two main purposes. First, it …
book
Android 9 Development Cookbook - Third Edition
Build feature-rich, reliable Android Pie apps with the help of more than 100 proven industry standard …
book
Asynchronous Android Programming - Second Edition
Unlock the power of multi-core mobile devices to build responsive and reactive Android applications About This …