One of Kotlin Coroutine actual combat

What problems does the Android collaboration solve?Handle time-consuming tasks that often block the main threadEnsure that the main thread is safe and that any suspend function is safely called from the main threadExample (asynchronous task)Implement an example of requesting network data: there is a button, a loading and a textview on the page ...

Added by AudiS2 on Tue, 04 Jan 2022 12:37:27 +0200

[Kotlin beginners] simple analysis and use of generics

About the author: CSDN blog expert, Huawei cloud sharing expert certification Series column: Kotlin beginner Learning and communication: three people must have my teacher; Choose the good and follow it, and change the bad. catalogue 1, Generic usage 1.1 advantages of generics 1.2 generic classes 1.3 generic functions 1.4 generic int ...

Added by JoeF on Sun, 02 Jan 2022 22:37:07 +0200

Preparation of Hang function of Kotlin coroutine

1, Foreword In the previous example, we know that we can start a co process through launch or async and control its life cycle. We also know that async can run in parallel. Other operations are recorded here 2, Delayed start process A collaborative process can be defined in advance and then started when a certain condition is triggered, ...

Added by genesysmedia on Sun, 02 Jan 2022 08:02:05 +0200

Kill RxJava series -- 2 Handwritten FlowBus replaces RxBus/EventBus/LiveDataBus

Lack of LiveData LiveData is an observable data storage class dedicated to Android with autonomous life cycle awareness. It is deliberately simplified in design, which makes it easy for developers to start, but its shortcomings are as follows: LiveData can only update data in the main thread (the underlying layer of postValue is also switched ...

Added by rednax on Fri, 31 Dec 2021 11:29:45 +0200

[Kotlin beginner] extension - enjoy programming

About the author: CSDN blog expert, Huawei cloud · cloud sharing expert certification Series column: Kotlin beginner Learning and communication: three people must have my teacher; Choose the good and follow it, and change the bad. catalogue 1, Introduction 2, Extension function 2.1 defining extension functions 2.1. 4 define th ...

Added by gnunoob on Fri, 31 Dec 2021 01:45:48 +0200

KOtlin type advanced

Learning objectives: Master Kotlin type, skillfully use and advanced Learning content: Class constructorVisibility of classes and membersDelayed initialization of class propertiesDelegate agentSingleton objectInner classData classEnumeration classSealing classInline class Study time: Time is like water in a sponge. There is always a squee ...

Added by jvanv8 on Thu, 30 Dec 2021 14:32:43 +0200

What if there are too few JetPack Compose theme colors? Let's design our own color system

introductionThe official version of JetPack Compose has been released for several months. During this period, in addition to business-related requirements, I also started the landing experiment of Compose in the actual project, because once I want to access the current project, the problems encountered are actually far greater than those requir ...

Added by jtown on Tue, 28 Dec 2021 21:05:50 +0200

How ViewModel saves state

1, Foreword Although ViewModel has helped us deal with the data retention problem caused by page destruction and reconstruction caused by screen rotation, the data is not saved for page destruction and reconstruction caused by insufficient memory. This article mainly makes a unified improvement and arrangement according to the official doc ...

Added by centenial on Wed, 22 Dec 2021 18:26:05 +0200

[Kotlin beginner] empty safety and exception

catalogue 1, Air safety 1.1 null pointer 1.2 nullability (?) 1.3 safe call operator (?.) 1.4 let operator 1.5 use non null assertion operator (!!!.) 1.6 use the empty merge operator (?:) 1.7 using the type conversion operator (as) 1.7. 1 unsafe conversion operator: as 1.7. 8. Safe conversion operator: as? 2, Abnormal 2.1 concept 2. ...

Added by xisle on Wed, 22 Dec 2021 18:22:54 +0200

AOP learning notes (Android)

AOP learning notes (Android) AOP: aspect oriented programming is a technology that realizes the unified maintenance of program functions through dynamic agents during precompiling and running. AOP is the continuation of OOP (object-oriented programming). Using AOP, each part of business logic can be isolated, so as to reduce the coupling be ...

Added by NevadaSam on Mon, 20 Dec 2021 05:05:15 +0200