Efficient Android threading: [asynchronous processing techniques for Android applications]
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Beijing [u.a.]
O'Reilly
2014
|
Ausgabe: | 1. ed. |
Schriftenreihe: | Programming / Android
|
Schlagworte: | |
Online-Zugang: | Inhaltstext Inhaltsverzeichnis |
Beschreibung: | XVI, 260 S. graph. Darst. |
ISBN: | 9781449364137 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV042035524 | ||
003 | DE-604 | ||
007 | t | ||
008 | 140820s2014 d||| |||| 00||| eng d | ||
020 | |a 9781449364137 |9 978-1-449-36413-7 | ||
035 | |a (OCoLC)885403368 | ||
035 | |a (DE-599)HBZHT018301932 | ||
040 | |a DE-604 |b ger |e rakddb | ||
041 | 0 | |a eng | |
049 | |a DE-11 |a DE-573 | ||
082 | 0 | |a 005 | |
084 | |a ST 261 |0 (DE-625)143633: |2 rvk | ||
100 | 1 | |a Göransson, Anders |e Verfasser |4 aut | |
245 | 1 | 0 | |a Efficient Android threading |b [asynchronous processing techniques for Android applications] |c Anders Göransson |
250 | |a 1. ed. | ||
264 | 1 | |a Beijing [u.a.] |b O'Reilly |c 2014 | |
300 | |a XVI, 260 S. |b graph. Darst. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
490 | 0 | |a Programming / Android | |
650 | 0 | 7 | |a Android |g Systemplattform |0 (DE-588)7635475-1 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Programmierung |0 (DE-588)4076370-5 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a App |g Programm |0 (DE-588)7705206-7 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Android |g Systemplattform |0 (DE-588)7635475-1 |D s |
689 | 0 | 1 | |a App |g Programm |0 (DE-588)7705206-7 |D s |
689 | 0 | 2 | |a Programmierung |0 (DE-588)4076370-5 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m X:MVB |q text/html |u http://deposit.dnb.de/cgi-bin/dokserv?id=4634875&prov=M&dok_var=1&dok_ext=htm |3 Inhaltstext |
856 | 4 | 2 | |m HBZ Datenaustausch |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=027476900&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
943 | 1 | |a oai:aleph.bib-bvb.de:BVB01-027476900 |
Datensatz im Suchindex
_version_ | 1806328853648375808 |
---|---|
adam_text |
Titel: Efficient android threading
Autor: Göransson, Anders
Jahr: 2014
Table of Contents Preface. xi 1. Android Components and the Need for Multiprocessing. 1 Android Software Stack 1 Application Architecture 2 Application 3 Components 3 Application Execution 5 Linux Process 6 Lifecycle 6 Structuring Applications for Performance 9 Creating Responsive Applications Through Threads 9 Summary 11 Parti. Fundamentals 2. Multithreading in Java. 15 Thread Basics 15 Execution 15 Single-Threaded Application 17 Multithreaded Application 17 Thread Safety 19 Intrinsic Lock and Java Monitor 20 Synchronize Access to Shared Resources 22 Example: Consumer and Producer 24 Task Execution Strategies 26 Concurrent Execution Design 27
Summary 27 Threads on Android. . 29 Android Application Threads 29 U1 Thread 29 Binder Threads 30 Background Threads 30 The Linux Process and Threads 31 Scheduling 34 Summary 37 Thread Communication. . 39 Pipes 39 Basic Pipe Use 40 Example: Text Processing on a Worker Thread 42 Shared Memory 44 Signaling 45 BlockingQueue 46 Android Message Passing 47 Example: Basic Message Passing 49 Classes Used in Message Passing 51 Message 55 hooper 58 Handler 60 Removing Messages from the Queue 68 Observing the Message Queue 70 Communicating with the UI Thread 73 Summary 74 Interprocess Communication. . 75 Android RPC 75 Binder 76 AIDE 77 Synchronous RPC 79 Asynchronous RPC 81 Message Passing Using the Binder 83 One- Wav Communication 84 Two - Way Com m un icat io n 86 Summary 87 Memory Management. . 89 Garbage Collection 89 vi | Table of Contents
Thread-Related Memory Leaks 91 Thread Execution 92 Thread Communication 98 Avoiding Memory Leaks 101 Use Static Inner Classes 101 Use Weak References 101 Stop Worker Thread Execution 102 Retain Worker Threads 102 Clean Up the Message Queue 102 Summary 103 Part II. Asynchronous Techniques 7. Managing the Lifecycle of a Basic Thread. 107 Basics 107 Lifecycle 107 Interruptions 108 Uncaught Exceptions 110 Thread Management 112 Definition and Start 112 Retention 114 Summary 119 8. HandlerThread: A High-Level Queueing Mechanism. 121 Fundamentals 121 Lifecycle 123 Use Cases 124 Repeated Task Execution 125 Related Tasks 125 Task Chaining 128 Conditional Task Insertion 131 Summary 131 9. Control over Thread Execution Through the Executor Framework. 133 Executor 133 Thread Pools 136 Predefined Thread Pools 136 Custom Thread Pools 137 Designing a Thread Pool 138 Lifecycle 142 Shutting Down the Thread Pool 143 Table of Contents | vii
Thread Pool Uses Cases and Pitfalls 145 Task Management 146 Task Representation 146 Submitting Tasks 147 Rejecting Tasks 151 ExecutorCompIetionService 152 Summary 154 10. Tying a Background Task to the Ul Thread with AsyncTask. 157 Fundamentals 157 Creation and Start 160 Cancellation 161 States 162 Implementing the AsyncTask 163 Example: Downloading Images 164 Background Task Execution 167 Application Global Execution 169 Execution Across Platform Versions 170 Custom Execution 172 AsyncTask Alternatives 173 When an AsyncTask Is Trivially Implemented 173 Background Tasks That Need a Looper 174 Local Service 174 Using execute(Runnable) 174 Summary 175 11. Services. 177 Why Use a Service for Asynchronous Execution? 177 Local, Remote, and Global Services 179 Creation and Execution 181 Lifecycle 181 Started Service 183 Implementing onStartCommand 184 Options for Restarting 184 User-Controlled Service 186 Task-Controlled Service 190 Bound Service 192 Local Binding 194 Choosing an Asynchronous Technique 197 Summary 198 12. IntentService. 199 viii | Table of Contents
Fundamentals 199 Good Ways to Use an IntentService 201 Sequentially Ordered Tasks 201 Asynchronous Execution in BroadcastReceiver 204 IntentService Versus Service 207 Summary 207 13. Access ContentProviders with AsyncQueryHandler. 209 Brief Introduction to ContentProvider 209 Justification for Background Processing of a ContentProvider 211 Using the AsyncQueryHandler 212 Example: Expanding Contact List 214 Understanding the AsyncQueryHandler 217 Limitations 218 Summary 218 14. Automatic Background Execution with Loaders. 219 Loader Framework 220 LoaderManager 221 LoaderCallbacks 224 AsyncTaskLoader 225 Painless Data Loading with CursorLoader 226 Using the CursorLoader 227 Example: Contact list 227 Adding CRUD Support 229 Implementing Custom Loaders 233 Loader Lifecycle 233 Background Loading 234 Content Management 236 Delivering Cached Results 237 Example: Custom File Loader 238 Handling Multiple Loaders 241 Summary 242 15. Summary: Selecting an Asynchronous Technique. 243 Keep It Simple 244 Thread and Resource Management 244 Message Communication for Responsiveness 245 Avoid Unexpected Task Termination 246 Easy Access to ContentProviders 247 A. Bibliography. 249 Table of Contents | ix
Index, 251 X I Table of Contents |
any_adam_object | 1 |
author | Göransson, Anders |
author_facet | Göransson, Anders |
author_role | aut |
author_sort | Göransson, Anders |
author_variant | a g ag |
building | Verbundindex |
bvnumber | BV042035524 |
classification_rvk | ST 261 |
ctrlnum | (OCoLC)885403368 (DE-599)HBZHT018301932 |
dewey-full | 005 |
dewey-hundreds | 000 - Computer science, information, general works |
dewey-ones | 005 - Computer programming, programs, data, security |
dewey-raw | 005 |
dewey-search | 005 |
dewey-sort | 15 |
dewey-tens | 000 - Computer science, information, general works |
discipline | Informatik |
edition | 1. ed. |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>00000nam a2200000 c 4500</leader><controlfield tag="001">BV042035524</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">140820s2014 d||| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781449364137</subfield><subfield code="9">978-1-449-36413-7</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)885403368</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)HBZHT018301932</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rakddb</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-11</subfield><subfield code="a">DE-573</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">005</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 261</subfield><subfield code="0">(DE-625)143633:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Göransson, Anders</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Efficient Android threading</subfield><subfield code="b">[asynchronous processing techniques for Android applications]</subfield><subfield code="c">Anders Göransson</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">1. ed.</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Beijing [u.a.]</subfield><subfield code="b">O'Reilly</subfield><subfield code="c">2014</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XVI, 260 S.</subfield><subfield code="b">graph. Darst.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="490" ind1="0" ind2=" "><subfield code="a">Programming / Android</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Android</subfield><subfield code="g">Systemplattform</subfield><subfield code="0">(DE-588)7635475-1</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Programmierung</subfield><subfield code="0">(DE-588)4076370-5</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">App</subfield><subfield code="g">Programm</subfield><subfield code="0">(DE-588)7705206-7</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Android</subfield><subfield code="g">Systemplattform</subfield><subfield code="0">(DE-588)7635475-1</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">App</subfield><subfield code="g">Programm</subfield><subfield code="0">(DE-588)7705206-7</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="2"><subfield code="a">Programmierung</subfield><subfield code="0">(DE-588)4076370-5</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">X:MVB</subfield><subfield code="q">text/html</subfield><subfield code="u">http://deposit.dnb.de/cgi-bin/dokserv?id=4634875&prov=M&dok_var=1&dok_ext=htm</subfield><subfield code="3">Inhaltstext</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">HBZ Datenaustausch</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=027476900&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="943" ind1="1" ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-027476900</subfield></datafield></record></collection> |
id | DE-604.BV042035524 |
illustrated | Illustrated |
indexdate | 2024-08-03T01:43:52Z |
institution | BVB |
isbn | 9781449364137 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-027476900 |
oclc_num | 885403368 |
open_access_boolean | |
owner | DE-11 DE-573 |
owner_facet | DE-11 DE-573 |
physical | XVI, 260 S. graph. Darst. |
publishDate | 2014 |
publishDateSearch | 2014 |
publishDateSort | 2014 |
publisher | O'Reilly |
record_format | marc |
series2 | Programming / Android |
spelling | Göransson, Anders Verfasser aut Efficient Android threading [asynchronous processing techniques for Android applications] Anders Göransson 1. ed. Beijing [u.a.] O'Reilly 2014 XVI, 260 S. graph. Darst. txt rdacontent n rdamedia nc rdacarrier Programming / Android Android Systemplattform (DE-588)7635475-1 gnd rswk-swf Programmierung (DE-588)4076370-5 gnd rswk-swf App Programm (DE-588)7705206-7 gnd rswk-swf Android Systemplattform (DE-588)7635475-1 s App Programm (DE-588)7705206-7 s Programmierung (DE-588)4076370-5 s DE-604 X:MVB text/html http://deposit.dnb.de/cgi-bin/dokserv?id=4634875&prov=M&dok_var=1&dok_ext=htm Inhaltstext HBZ Datenaustausch application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=027476900&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Göransson, Anders Efficient Android threading [asynchronous processing techniques for Android applications] Android Systemplattform (DE-588)7635475-1 gnd Programmierung (DE-588)4076370-5 gnd App Programm (DE-588)7705206-7 gnd |
subject_GND | (DE-588)7635475-1 (DE-588)4076370-5 (DE-588)7705206-7 |
title | Efficient Android threading [asynchronous processing techniques for Android applications] |
title_auth | Efficient Android threading [asynchronous processing techniques for Android applications] |
title_exact_search | Efficient Android threading [asynchronous processing techniques for Android applications] |
title_full | Efficient Android threading [asynchronous processing techniques for Android applications] Anders Göransson |
title_fullStr | Efficient Android threading [asynchronous processing techniques for Android applications] Anders Göransson |
title_full_unstemmed | Efficient Android threading [asynchronous processing techniques for Android applications] Anders Göransson |
title_short | Efficient Android threading |
title_sort | efficient android threading asynchronous processing techniques for android applications |
title_sub | [asynchronous processing techniques for Android applications] |
topic | Android Systemplattform (DE-588)7635475-1 gnd Programmierung (DE-588)4076370-5 gnd App Programm (DE-588)7705206-7 gnd |
topic_facet | Android Systemplattform Programmierung App Programm |
url | http://deposit.dnb.de/cgi-bin/dokserv?id=4634875&prov=M&dok_var=1&dok_ext=htm http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=027476900&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT goranssonanders efficientandroidthreadingasynchronousprocessingtechniquesforandroidapplications |