Opis
Developing applications for the Android mobile operating system can seem daunting, particularly if it requires learning a new programming language: Kotlin, now Androidâ??s officialdevelopment language. With this practical book, Android developers will learn how to make the transition from Java to Kotlin, including how Kotlin provides a true advantage for gaining control over asynchronous computations.Authors Pierre-Olivier Laurence, Amanda Hinchman-Dominguez, G. Blake Meike, and Mike Dunn explore implementations of the most common tasks in native Android development, and show you how Kotlin can help you solve concurrency problems. With a focus on structured concurrency, a new asynchronous programming paradigm, this book will guide you through one of Kotlins most powerful constructs, coroutines.Learn about Kotlin essentials and the Kotlin Collections FrameworkExplore Android fundamentals: the operating system and the application container and its componentsLearn about thread safety and how to handle concurrencyWrite sequential, asynchronous work at a low costExamine structured concurrency with coroutines, and learn how channels make coroutines communicateLearn how to use flows for asynchronous data processingUnderstand performance considerations using Android profiling toolsUse performance optimizations to trim resource consumption Spis treści:PrefaceWho Should Read This BookWhy We Wrote This BookNavigating This BookConventions Used in This BookUsing Code ExamplesOReilly Online LearningHow to Contact UsAcknowledgments1. Kotlin EssentialsThe Kotlin Type SystemPrimitive TypesNull SafetyThe Unit TypeFunction TypesGenericsVariables and FunctionsVariablesLambdasExtension FunctionsClassesClass InitializationPropertieslateinit PropertiesLazy PropertiesDelegatesCompanion ObjectsData ClassesEnum ClassesSealed ClassesVisibility ModifiersSummary2. The Kotlin Collections FrameworkCollection BasicsJava InteroperabilityMutabilityOverloaded OperatorsCreating ContainersFunctional ProgrammingFunctional Versus Procedural: A Simple ExampleFunctional AndroidKotlin Transformation FunctionsThe Boolean FunctionsFilter FunctionsMapflatMapGroupingIterators Versus SequencesAn ExampleThe ProblemThe ImplementationSummary3. Android FundamentalsThe Android StackHardwareKernelSystem ServicesAndroid Runtime EnvironmentApplicationsThe Android Application EnvironmentIntents and Intent FiltersContextComponent contextApplication contextAndroid Application Components: The Building BlocksThe Activity and Its FriendsFragmentsThe back stackServicesStarted ServicesBound ServicesContent ProvidersBroadcast ReceiversAndroid Application ArchitecturesMVC: The FoundationWidgetsThe Local ModelAndroid PatternsModelViewIntentModelViewPresenterModelViewViewModelSummary4. Concurrency in AndroidThread SafetyAtomicityVisibilityThe Android Threading ModelDropped FramesMemory LeaksTools for Managing ThreadsLooper/HandlerExecutors and ExecutorServicesTools for Managing JobsJobSchedulerWorkManagerSummary5. Thread SafetyAn Example of a Thread IssueInvariantsMutexesThread-Safe CollectionsThread ConfinementThread ContentionBlocking Call Versus Nonblocking CallWork QueuesBack PressureSummary6. Handling Concurrency Using CallbacksExample-of-Purchase FeatureCreating the AppView-ModelViewImplement the LogicDiscussionStructured concurrencyMemory leaksLimitations of the Threading ModelSummary7. Coroutines ConceptsWhat Exactly Is a Coroutine?Your First CoroutineThe async Coroutine BuilderA Quick Detour About Structured ConcurrencyThe Parent-Child Relationship in Structured ConcurrencyCoroutineScope and CoroutineContextSuspending FunctionsSuspending Functions Under the HoodUsing Coroutines and Suspending Functions:A Practical ExampleDont Be Mistaken About the suspend ModifierSummary8. Structured Concurrency with CoroutinesSuspending FunctionsSet the SceneTraditional Approach Using java.util.concurrent.ExecutorServiceA Reminder About HandlerThreadUsing Suspending Functions and CoroutinesSummary of Suspending Functions Versus Traditional ThreadingCancellationCoroutine LifecycleCoroutine cancellationJob holds the stateCancelling a CoroutineCancelling a Task Delegated to a Third-Party LibraryCoroutines That Are Cooperative with Cancellationdelay Is CancellableHandling CancellationCauses of CancellationSupervisionsupervisorScope BuilderParallel DecompositionAutomatic CancellationException HandlingUnhandled Versus Exposed ExceptionsExposed ExceptionsUnhandled ExceptionsSummaryClosing Thoughts9. ChannelsChannels OverviewRendezvous ChannelIterating over a ChannelOther flavors of ChannelUnlimited ChannelConflated ChannelBuffered ChannelChannel ProducersCommunicating Sequential ProcessesModel and ArchitectureA First ImplementationThe select ExpressionPutting It All TogetherFan-Out and Fan-InPerformance TestBack PressureSimilarities with the Actor ModelExecution Is Sequential Inside a ProcessFinal ThoughtsDeadlock in CSPTL;DRLimitations of ChannelsChannels Are HotSummary10. FlowsAn Introduction to FlowsA More Realistic ExampleOperatorsTerminal OperatorsExamples of Cold Flow UsageUse Case #1: Interface with a Callback-Based APIUse Case #2: Concurrently Transform a Stream of ValuesWhat Happens in Case of Error?Final ThoughtsUse Case #3: Create a Custom OperatorUsageError HandlingThe try/catch BlockSeparation of Concern Is ImportantException Transparency ViolationThe catch OperatorException transparencyAnother exampleYou can use emit from inside catchMaterialize Your ExceptionsA bonusHot Flows with SharedFlowCreate a SharedFlowRegister a SubscriberSend Values to the SharedFlowUsing SharedFlow to Stream DataThe architectureThe implementationTest of our implementationReplay valuesSuspend or not?Buffer valuesUsing SharedFlow as an Event BusStateFlow: A Specialized SharedFlowAn Example of StateFlow UsageSummary11. Performance Considerations withAndroid Profiling ToolsAndroid ProfilerNetwork ProfilerViewing network calls with Connection View and Thread ViewNetwork call, expanded: Overview | Response | Request | CallstackCPU ProfilerCPU timelineThread activity timelineAnalysis panelMethod tracingRecording a sample method traceEnergy ProfilerMemory ProfilerDetecting Memory Leaks with LeakCanarySummary12. Trimming Down Resource Consumption with Performance OptimizationsAchieving Flatter View Hierarchy with ConstraintLayoutReducing Programmatic Draws with DrawablesMinimizing Asset Payload in Network CallsBitmap Pooling and CachingReducing Unnecessary WorkUsing Static FunctionsMinification and Obfuscation with R8 and ProGuardSummaryIndex
zamek do drzwi przesuwnych drewnianych, fioletowa cukinia, kosz na śmieci pod zlew, podłogi winylowe cena, drzwi.przesuwne, zatyczka do gniazdka, ścianka działowa do pokoju, listwy łączące blaty kuchenne, nozyce do zywoplotu spalinowe, przecinarka do płytek macallister, szafka wisząca z lustrem do łazienki, prysznic ze ściankami, szpachlowka do drewna, zawieszka do półek, palisady betonowe, zszywki 6mm, syfon do umywalki płaski, uchwyt do regipsu, grzejnik łazienkowy 50 cm, farba morska zieleń, bloczki 10 cm
yyyyy