文件名称:
Efficient Android Threading_2014
开发工具:
文件大小: 2mb
下载次数: 0
上传时间: 2015-02-08
详细说明: Contents Overview Copyright About the Author I. Introduction 1. Android Components and the Need for Multi-Processing Android Software Stack Application Architecture Application Components Activity Service ContentProvider BroadcastReceiver Application Execution Linux Process Lifecycle Application Start Application Termination Structuring Applications for Performance Creating Responsive Applications Through Threads Summary II. Fundamentals 2. Multithreading in Java Thread Basics Execution Single-Threaded A pplication Multi-Threaded Application Increased Resource Consumption Increased Complexity Data Inconsistency Thread Safety Intrinsic Lock and Java Monitor Synchronize Access to Shared Resources Using the Intrinsic Lock Using Explicit Locking Mechanisms Example: Consumer and Producer Task Execution Strategies Concurrent Execution Design 3 Summary 3. Threads on Android Android Application Threads UI Thread Binder threads Background threads The Linux Process and Threads Scheduling Priority Control groups Summary 4. Thread Communication Pipes Basic Pipe Use Text processing on a worker thread Shared memory Signalling BlockingQueue Android Message Passing Basic Message Passing Example Classes Used in Message Passing MessageQueue MessageQueue.IdleHandler Example: Using IdleHandler to terminate an unused thread Message Initialized Pending Dispatched Recycled Looper Looper termination The UI thread Looper Handler Setup Message creation Message insertion Example: Two-way message passing Message processing Removing Messages from the Queue Observing the Message Queue 4 Taking a snapshot of the current message queue Tracing the message queue processing Communicating with the UI Thread Summary 5. Interprocess Communication Android RPC Binder AIDL Synchronous RPC Asynchronous RPC Message-Passing Using the Binder One-way communication Two-way communication Summary 6. Memory Management Garbage collection Thread related memory leaks Thread execution Inner classes Static inner classes The lifecycle mismatch Thread communication Sending a data message Posting a task message Avoiding memory leaks Use Static Inner Classes Use Weak References Stop Worker Thread Execution Retain Worker Threads Clean Up the Message Queue Summary III. Asynchronous Techniques 7. Managing the Lifecycle of a Basic Thread Basics Lifecycle Interruptions Uncaught Exceptions Thread management Definition and start Anonymous inner class 5 Public thread Static inner class thread definition Summary of options for thread definition Retention Retaining a Thread in an Activity Retaining a Thread in a Fragment Summary 8. HandlerThread: a High-Level Queueing Mechanism Fundamentals Lifecycle Use Cases Repeated Task Execution Related Tasks Example: Data persistence with SharedPreferences Task Chaining Example: chained network calls Conditional task insertion Summary 9. Control Over Thread Execution Through the Executor Framework Executor Thread Pools Predefined Thread Pools Custom Thread Pools ThreadPoolExecutor Configuration Thread configuration Extending ThreadPoolExecutor Lifecycle Shutting Down the Thread Pool Task management Task representation FutureTask Submitting Tasks Individual submission invokeAll invokeAny Rejecting Tasks ExecutorCompletionService Summary 10. Tying a Background task to the UI Thread with AsyncTask Fundamentals 6 Creation and Start Cancellation States Example: Limiting an AsyncTask execution to one at the time Implementing the AsyncTask Example: Downloading Images Background Task Execution Application Global Execution Execution Across Platform Versions Custom Execution Example: non-global sequential execution AsyncTask Alternatives When an AsyncTask is trivially implemented Background Tasks that Need a Looper Local Service Using execute(Runnable) Summary 11. Services Why Use a Service For Asynchronous Execution? Local, Remote, and Global Services Creation and Execution Lifecycle Started Service Implementing onStartCommand Options for Restarting User-Controlled Service Example: Bluetooth Connection Task-Controlled Service Example: Concurrent Download Bound Service Local Binding Choosing an Asynchronous Technique Summary 12. IntentService Fundamentals Good Ways To Use An IntentService Sequential Ordered Tasks Example: Web Service Communication Asynchronous Execution in BroadcastReceiver Example: Periodical Long Operations 7 IntentService Versus Service Summary ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.