1. 首页
  2. 移动开发
  3. Android
  4. Asynchronous Android Programming

Asynchronous Android Programming

上传者: 2019-09-19 22:05:14上传 PDF文件 2.49MB 热度 36次
"Asynchronous Android Programming"English | ISBN: 1785883240 | 2016 | 394 pagesAbout This BookConstruct scalable and performant applications to take advantage of multi-thread asynchronous techniquesExplore the high-level Android asynchronous constructs available on the Android SDKChoose the moAsynchronous Android ProgrammingSecond editionCopyright o 2016 Packt PublishingAll rights reserved. No part of this book may be reproduced, stored in a retrievalsystem, or transmitted in any form or by any means, without the prior writtenpermission of the publisher, except in the case of brief quotations embedded incritical articles or reviewsEvery effort has been made in the preparation of this book to ensure the accuracyof the information presented. However, the information contained in this book issold without warranty, either express or implied. Neither the author, nor PacktPublishing, and its dealers and distributors will be held liable for any damagescaused or alleged to be caused directly or indirectly by this bookPackt Publishing has endeavored to provide trademark information about all of thecompanies and products mentioned in this book by the appropriate use of capitalsH lowever, Packt Publishing cannot guarantee the accuracy of this informationFirst published July 2016Production reference: 1260716Published by packt Publishing ltdLivery place35 Livery streetBirmingham b3 2PB, UKISBN9781-78588324-8www.packtpub.comCreditsAuthorProject CoordinatorHelder vasconcelosReviewerProofreaderGavin matthewsSafis EditingCommissioning editorIndexerEdward gordonMariamman ChettiyarAcquisition EditorGraphicsIndrajit dasDisha hariaContent Development editorProduction coordinatorSiddhesh salviArvindkumar GuptaTechnical editorCover workDanish shaikhArvindkumar guptaCopy EditorVibha shuklaabout the authorHelder vasconcelos is a Portuguese Software Engineer based on Dublin,Ireland, with more than 10 years of experience designing and developingreal-time/multithreaded Java and C++ applications for the telecommunicationsand aviation industries. Apart from his day-to-day job, he occupies his sparetime building native Android applications for Bearstouch Software anr areother third-party companiesHe graduated with a degree in Electronic and Telecommunications Engineeringfrom the University of Aveiro in January 2006. During his career, he has workedas a Software Engineer for companies such as PT Inovasao(Portugal), AirtelATNDublin, Ireland) and AxwayDublin, Ireland). You can find Helder on LinkedInat(https://ie.linkedin.com/in/heldervasc/enoronhiswebsiteat(http://hvasconcelos.github.io)i would like to sincerely thanks all technical reviewers but especiallyGavin. i really appreciate your invaluable feedback and commit thatshaped the quality of the book. a special thanks to my awesome wifeTania for encourage me when the lack of motivation was killing myproductivity. It would not have been possible without your precioussupport. Thanks also to my parents and family for their awesomeeffort in my education. Additionally, I would like to thank myfriends, colleagues, clients, and teachers for helping me to shape andimprove my skills and perspectives during my careerAbout the reviewerGavin Matthews is a veteran software engineer specializing in enterprise scaleB2B, MFT and EFSS systemsWww. Packtpub. comeBooks, discount offers, and moreDid you know that Packt offers e Book versions of every book published with PDFandepubfilesavailableYoucanupgradetotheebookversionatwww.packtpubcom and as a print book customer, you are entitled to a discount on the e Book copyGet in touch with us at customercareapacktpub com for more detailsAtwww.packtPub.comyoucanalsoreadacollectionoffreetechnicalarticlessignup for a range of free newsletters and receive exclusive discounts and offers on Packtbooks and ebooksPACKTLIBhttps://www2.packtpub.com/books/subscription/packtlibDo you need instant solutions to your If questions? PacktLib is Packt's online digitalbook library. Here, you can search, access, and read Packt's entire library of booksWhy subscribe?Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browserTable of contentsPrefaceChapter 1: Asynchronous Programming in AndroidAndroid software stackDalvik runtimeaRT runtimeAndroid process modeleMemory sharing and ZygoteProcess ranksProcess sandboxingAndroid thread modelThe main threadThe Application Not Responding(ANR)dialogMaintaining responsiveness234556679024Concurrency in AndroidCorrectness issues in concurrent programsLiveness issues in concurrent programs16Thread coordination16Concurrent package constructs19Eⅹ ecutor frameworkAndroid primary building blocks21Activity concurrent issues21Manipulating the user interface23Service concurrent issues25Started services issues25Bound services issues26Service in a separate process2Broadcast receiver concurrent issues28Android concurrency constructs28ummaryTable of contentsChapter 2: Performing Work with Looper, Handler,and handlerthread31Understanding Looper32Understanding Handler34Sending work to a Looper37Scheduling work with post39Using handler to defer work40Leaking implicit references41Leaking explicit references43Updating the UI with Handler45Canceling a pending runnable46Scheduling work with send47Cancelling pending messages50Composition versus inheritance52Multithreading with Handler and Threadhandler53Looper message dispatching debuggingSending messages versus posting runnables59Applications of Handler and Handler Thread59Summary60Chapter 3: Exploring thele AsyncTask61Introducing AsyncTask62Declaring AsyncTask types65Executing Async Tasks6Providing indeterministic progress feedback69Providing deterministic progress feedbackCanceling an Async Task75Async Task Execution State78Handling exceptions79Controlling the level of concurrency81Common Async Task issues84Fragmentation issues84Memory leaks85Activity lifecycle issues85Handling lifecycle issues with early cancellationHandling lifecycle issues with retained headless fragments87Applications of Async Task92Summary93Chapter 4: Exploring the Loader95Introducing Loaders96Loader aP96Loader97lITable of ContentsLoader ManagerLoader Manager. LoaderCallbacksoader lifecycle100Loading data with Loader101Building responsive apps with AsyncTaskLoader107Building responsive apps with CursorLoader116Combining Loaders119Applications of Loader125Summary25Chapter 5: Interacting with services127Introducing Service128Started service131Building responsive apps with IntentService136Handling results139Posting results with PendingIntent139Posting results as system notifications142Applications of IntentService143Http uploads with Intentservice144Reporting progress146Bound service149Communicating with a Local Service150Broadcasting results with intents158Detecting unhandled broadcasts160Applications of Services163Summary164Chapter 6: Scheduling Work with AlarmManager165Introducing AlarmManager166Scheduling alarms with AlarmManagerSetting alarms in recent android versions169Testing your alarms in Doze Mode72Setting a Window alarm173Debugging AlarmManager alarms173Canceling alarms175Scheduling repeating alarms76Scheduling an alarm clock178Handling alarms179Handling alarms with Activities180Handling alarms with BroadcastReceiver181Working with BroadcastReceiver183Asynchronous work with goAsync186[ⅲi
下载地址
用户评论
码姐姐匿名网友 2019-09-19 22:05:14

感谢分享!!!

码姐姐匿名网友 2019-09-19 22:05:14

非常好的资料,感谢分享!