Listening to Activity life cycle mode and case explanation
Articles on listening Activity life cycle in two ways: add fragments and registerActivityLifecycleCallback and in lifecycle, Glide, PermissionX applications
Three Kotlin development tips you need to know
1. Nested functions; 2.@JvmOverloads quick implementation of function overloading 3. Late initialization 'lateinit var' 4.@JvmField reduces the generation of attribute set and get methods
Eliminate shape and manually build GradientDrwable
Manually build GradientDrawable instead of XML shape. The background of the original XML implementation has two drawbacks: 1. The number of XML files in the resource path is too large and it is difficult to manage. 2. Parsing XML files involves I/O, which increases the parsing time
Constructor in Kotlin, accompanying object explanation
Kotlin on constructors, associated objects and there are some things in Kotlin that seem pretty simple, like we can use them without any problems, right? But that doesn't mean we understand these are just points, we just know how to use them, and to understand them, we need to understand them, right
Introduction to Kotlin coroutines (1)
The prologue coroutine is a difficult concept in Kotlin and one of the most important features of its language. The concept of coroutines was not invented by Kotlin. It was proposed a long time ago, but it has been around for the last decade, especially in Python, Go and other languages that support coroutines
Full of ritual HelloWorld
With more and more Android development using Kotlin, and the ongoing feud between Google and Oracle, it's a foregone conclusion that Kotlin will become the dominant language for Android development. At the same time kotlin as
Android Kotlin coroutine Flow and Channel stuff
However, many of the functions of Flow can be replaced by RxJava. However, Flow provides a more straightforward API than RxJava. Moreover, G
Kotlin coroutines use CoroutineContext to implement retry logic after network requests fail
Kotlin coroutine context is used to retry network request errors. Automatic retry coroutines CoroutineExceptionHandler context, the network failure
Kotlin interacts with Java
Kotlin calls Java nullability All Java objects are nullable, but the compiler doesn't know it. Therefore, Kotlin cannot perform security checks at compile time. The nullable type returned by Java is called the platform type String! What if you don't use the security operator?
Readhub client developed based on Kotlin, ViewModel, LiveData and LifeCycle
I inadvertently paid attention to the public account of Non-code Technology before, from which I know their first product Readhub, the address of which is https://readhub.me/, mainly provides the latest news of the Internet. After paying attention for a period of time, I feel that the content quality is good, which can help us filter out some junk information. But it can only be viewed in the browser and wechat public account, plus its own...