Moment For Technology

Kotlin base | entrusted and its application

Entrust is a common pattern, it has nothing to do with programming language, namely themselves do entrusted to another object. Kotlin supports delegation at the language level. This article introduces Kotlin's delegation with examples.

SharedPreferences should be written like this with Kotlin

SharedPreferences is the lightest KeyValue persistence component available to Android developers, and everyone has their own package. And wechat based on MMAP MMKV high-performance KV components are not unfamiliar to everyone. So after Kotlin's arrival, are you still using Java? Have you...

Interesting Kotlin 0x0B: Copy

0x0B: Copy the above code, what is the result? Optional: one, two, one two, oops UnsupportedOperationException will not compile

Kotlin goes from implementing the String '+' operation to understanding operator overloading and function extension

When I started working, the company boss suggested learning from Kotlin, which would speed up development, prevent null Pointers, and a whole bunch of good things to use. But, at first, I didn't believe it. What is Kotlin? I heard that the return type of a function is always after the method name. However, in view of the big guy recommendation, it seems that understanding is necessary, so ,,,,,,,,...

Summary of kotlin's practical functions and Lambada expressions

In particular, the Kotlin series of articles focuses on Java differences and does not list the same parts as Java. With the iteration of the official version of Kotlin, some of the grammar may change, so be sure to pay attention to it. Just understand the essence of the language, and the difference is only at the grammar level. It is recommended not to pay too much attention to the grammar. Calling Java in Kotlin...

So drawable in Kotlin should look like this

Customize shapes and selectors to suit some UI designs. This article introduces the simple syntax features of the Kotlin DSL to implement the common drawable.

Breaking Kotlin coroutines (9) - Channel chapter

Channel is actually a queue, and it is concurrency safe, it can be used to connect coroutines, realize the communication of different coroutines. We created two coroutines called producer and Consumer. We did not specify the scheduler, so their scheduler is default.

Kotlin's practical tips you should know

Reified, the generic instantiation keyword in Kotlin, makes something abstract more concrete or real. In a Java serialization library such as Gson, when you want to deserialize the JSON string, you eventually have to pass the Class object as an argument so that Gson knows what type you want. SAM conversion, i.e., Single Abstract Met...

How do coroutine exceptions propagate?

1. How does a coroutine exception handler work? 2. How to handle exceptions when coroutine is cancelled? 3. How is the exception propagation mechanism different in different scopes implemented? 4. Summary of coroutine anomaly propagation flow chart

A brand new RecyclerView Adapter framework source source

And so on.. Third, keep the feature of dynamic extension, you understand the principle, you can also customize according to their own needs, the future official provide MergeAdapter combination, and we will do a WrapAdapter in the future, you will find more combination of possibilities. Fourth, due to the reuse of ViewHolder, there will always be some questions...

Search
About
mo4tech.com (Moment For Technology) is a global community with thousands techies from across the global hang out!Passionate technologists, be it gadget freaks, tech enthusiasts, coders, technopreneurs, or CIOs, you would find them all here.