• Out-of-Stock
android-apps-multithreaded technique-processing-anders-gransson
search
  • android-apps-multithreaded technique-processing-anders-gransson
ID: 557267

Anders Göransson

Delivery date unknown
 

Free shipping

free shipping in Poland for all orders over 500 PLN

 

Same day shipping

If your payment will be credited to our account by 11:00

 

14 days for return

Each consumer can return the purchased goods within 14 days

Original title: Efficient Android Threading: Asynchronous processing techniques for Android applications
Translation: Lech Lachowski
ISBN: 978-83-246-9614-7
Date of issue: 2015-02-24
Format: 168x237
Pages: 248


Make the most of the threads!

If you want to create applications that provide users with great experience, if you want to do complex tasks faster or you just have to do different things at the same time - learn how to use threads. Creating multithreaded programs is difficult, but mastering this art will allow you to achieve tangible benefits!

This book is entirely devoted to the use of threads on the Android platform. Thanks to it you will get to know various methods of asynchronous processing and their advantages and disadvantages. However, at the very beginning you will get acquainted with the basic information on Java multithreading. You will learn how threads communicate with each other and synchronize access to resources and how to manage them. The following chapters contain a large dose of knowledge about various asynchronous techniques. Familiarization with their content will help you choose a technique that will meet your requirements when you start developing a multi-threaded application. This book is a must-read for programmers who want to take full advantage of the Android platform.

  • Basics of multithreading in Java and Android.
  • Communication of threads within the process and between processes.
  • Application of strategies to reduce the risk of memory leaks.
  • Managing the basic thread life cycle.
  • Sequential running tasks in the background thread using the HandlerThread class.
  • Using the Java developer framework to control and cancel threads.
  • Support for performing tasks in the background using the AsyncTask and IntentService classes.
  • Accessing content providers using the AsyncQueryHandler class.
  • Using chargers to update the user interface with new data.

Guide to the world of threads on the Android platform!


Table of Contents

Foreword (11) 1. Components of the Android system and the need for multiprocessor processing (15)

  • Android program stack (15)
  • Application architecture (16)
    • Application (17)
    • Components (17)
  • Application development (19)
    • Linux system processes (19)
    • Life cycle (20)
  • Application structuring to improve performance (23)
    • Creating responsive applications using threads (23)
  • Summary (25)

PART I. BASIS (27) 2. Multithreading in Java (29)

  • Basics of threads (29)
    • Execution (29)
    • One-threaded application (30)
    • Multithreaded application (31)
  • Thread Safety (33)
    • Inner lock and Java monitor (34)
    • Synchronizing access to shared resources (35)
    • Example: consumer and producer (37)
  • Strategies for performing tasks (38)
    • Concurrent concurrency model (39)
  • Summary (40)

3. Threads in the Android system (41)

  • Threads of the Android application (41)
    • User interface threads (41)
    • Binding threads (42)
    • Threads in the background (42)
  • Process and threads of the Linux system (43)
    • Ordering (45)
  • Summary (48)

4. Thread communication (49)

  • Potoki (49)
    • Basic pipe usage (50)
    • Example: text processing in a working thread (51)
  • Shared memory (53)
    • Signaling (54)
  • BlockingQueue interface (55)
  • Messaging on Android (56)
    • Example: basic messaging (57)
    • Classes used in messaging (59)
    • Messages (63)
    • Looper (66)
    • Handler (67)
    • Deleting messages from the queue (75)
    • Observing the message queue (76)
  • Communication with user interface thread (79)
  • Summary (80)

5. Communication between processes (81)

  • Android RPC (81)
    • Binder (82)
  • AIDL language (83)
    • Synchronous RPC call (84)
    • Asynchronous RPC call (86)
  • Forwarding messages using a Binder object (88)
    • One-way communication (89)
    • Two-way communication (91)
  • Summary (92)

6. Memory management (93)

  • Memory recovery (93)
  • Memory leaks related to the thread (95)
    • Performing a thread (96)
    • Threads communication (101)
  • Avoiding memory leaks (103)
    • Using static internal classes (104)
    • Using weak references (104)
    • Stopping the execution of a worker thread (105)
    • Keeping worker threads (105)
    • Clearing the message queue (105)
  • Summary (106)

PART II. ASYNCHRONIC TECHNIQUES (107) 7. Basic thread life cycle management (109)

  • The basics (109)
    • Life cycle (109)
    • Breaks (110)
    • Uncapped exclusions (112)
  • Thread Management (113)
    • Defining and starting (113)
    • Retention (115)
  • Summary (120)

8. HandlerThread class: high-level queuing mechanism (121)

  • The basics (121)
  • Life cycle (123)
  • Cases of use (124)
    • Repeated task execution (124)
    • Related tasks (125)
    • Job Chaining (127)
    • Conditional task insertion (129)
  • Summary (130)

9. Checking the execution of a thread using the artist's framework (131)

  • Executor interface (131)
  • Thread Pools (133)
    • Predefined thread pools (134)
    • Custom Thread Pools (135)
    • Designing the thread pool (136)
    • Life cycle (139)
    • Closing the thread pool (140)
    • Use cases and thread pool trap (141)
  • Task management (143)
    • Task representation (143)
    • Validating tasks (144)
    • Dismissing tasks (147)
  • ExecutorCompletionService class (148)
  • Summary (150)

10. Binding a background task to a user interface thread using the AsyncTask class (151)

  • The basics (151)
    • Creating and running (154)
    • Cancellation (154)
    • States (155)
  • Implementation of the AsyncTask class (156)
    • Example: downloading images (157)
  • Performing a background task (160)
    • Global execution for applications (161)
    • Performing tasks in various versions of the platform (162)
    • Custom execution (164)
  • Alternatives to the AsyncTask class (165)
    • Trivial implementations of the AsyncTask class (165)
    • Background tasks requiring the Looper instance (166)
    • Local service (166)
    • Using the execute (Runnable) method (167)
  • Summary (167)

11. Services (169)

  • Why is it worth using the Service component to perform asynchronous? (169)
  • Local, remote and global services (171)
  • Creating and executing (172)
  • Life cycle (173)
  • Service being started (174)
    • Implementation of the onStartCommand method (175)
    • Restart options (176)
    • User-controlled service (178)
    • Service controlled by the task (181)
  • Bundled service (183)
    • Local binding (184)
  • Choosing an asynchronous technique (187)
  • Summary (188)

12. IntentService class (189)

  • The basics (189)
  • Good ways to use the IntentService class (190)
    • Tasks ordered sequentially (191)
    • Asynchronous execution in the BroadcastReceiver component (193)
  • Comparison of IntentService and Service classes (196)
  • Summary (196)

13. Accessing the ContentProvider class using the AsyncQueryHandler class (197)

  • A short introduction to the ContentProvider class (197)
  • Justification for ContentProvider background processing (199)
  • Using the AsyncQueryHandler class (200)
    • Example: expanding your contact list (201)
    • AsyncQueryHandler class (204)
    • Limitations (205)
  • Summary (205)

14. Automatic background execution using chargers (207)

  • Chargers Framework (208)
    • LoaderManager class (209)
    • LoaderCallbacks interfaces (211)
    • AsyncTaskLoader class (213)
  • Trouble-free data loading with the CursorLoader loader (213)
    • Using the CursorLoader loader (214)
    • Example: contact list (214)
    • Adding CRUD operations support (215)
  • Implementing custom chargers (219)
    • Lifetime of the loader (219)
    • Background Loading (220)
    • Content management (222)
    • Delivering cached results (223)
    • Example: a custom file loader (223)
    • Support for multiple chargers (226)
  • Summary (227)

15. Summary: selection of asynchronous technique (229)

  • Preserving simplicity (230)
  • Resource and thread management (230)
  • Exchange of messages to achieve responsiveness (231)
  • Avoiding an unexpected task termination (231)
  • Easy access to the ContentProvider class (232)

A. Bibliography (235) Index of reference (237)

557267

Other products in the same category (16)