Kotlin actual combat [4] iterative things: while and for

1. while loopkotlin's while and do while are consistent with Java syntax. Here's a brief lookwhile (condition) { //When the condition is true, the code body executes /*...*/ } do {//Execute unconditionally once, and then execute when the condition is true /*...*/ } while (condition)2. for loopThe for loop exists only in one form, which ...

Posted by mcgruff on Thu, 04 Nov 2021 03:35:01 -0700

Get data and bind to UI | MAD Skills

Welcome back MAD Skills Collection Paging 3.0! In the last article Paging 3.0 introduction In the article, we discussed the Paging library, learned how to integrate it into the application architecture and integrate it into the data layer of the application. We use PagingSource to obtain and use data for our application, and PagingConfig to cre ...

Posted by basdog22 on Sun, 31 Oct 2021 21:12:12 -0700

Access Google payment 4.0 (Kotlin)

preface Many game R & D students may need to access Google to pay. We all know the Google Documents. Sometimes it seems that they have grasped something but haven't grasped anything, resulting in the access work sometimes falling into a bottleneck. I sorted out the next Google payment interface, and added some explanatory text and extensio ...

Posted by ronz on Mon, 25 Oct 2021 01:46:17 -0700

First line of code Kotlin learning notes

Programming languages are divided into compiled languages and interpreted languages. Compiled languages are characterized by compiling source code into binary files at one time and then executing directly; Interpretative languages have an interpreter that interprets the source code into binary data at run time and then executes it. Therefor ...

Posted by songwind on Sun, 24 Oct 2021 06:34:03 -0700

Staying up late and fighting Android - Kotlin - [what is Kotlin's static]

👉 About the author As we all know, life is a long process, constantly overcoming difficulties and constantly reflecting on the process of progress. In this process, there will be a lot of questions and thoughts about life, so I decided to share all my thoughts, experiences and stories in order to find resonance!!! Focus on Android/Unity an ...

Posted by PCSpectra on Sat, 23 Oct 2021 18:28:01 -0700

Android Bitmap related knowledge points - type, creation, compression, conversion, etc

1, Bitmap storage format and memory calculation When we need to optimize performance or prevent OOM, we usually use RGB_565 this type. Because alpha_ Type 8 bitmap has only transparency and is not very useful. ARGB_4444 the display picture is not clear. ARGB_8888 takes up the most memory space. BItmap typeMemory occupied by one pixelALPHA ...

Posted by p3rk5 on Wed, 20 Oct 2021 13:07:10 -0700

kotlin serialization User Guide

Kotlin serialization is a plug-in officially provided by kotlin, which can serialize and deserialize kotlin objects. The supported serialization formats include JSON, Protobuf, CBOR, Hocon and Properties   serialization is easy to use: //serialize val data = Project("kotlinx.serialization", "Kotlin") val json = Json.encodeToS ...

Posted by messels on Thu, 07 Oct 2021 21:05:58 -0700

Why doesn't Compose have layout nesting problems?

Author: Ricardo mjiang preface Students who have done layout performance optimization know that in order to optimize the interface loading speed, the layout level should be reduced as much as possible. This is mainly because the increase of layout level may lead to the exponential growth of measurement time. Composition does not have this p ...

Posted by SteveMT on Thu, 30 Sep 2021 13:49:09 -0700

Java turns to Kotlin and points north

preface Java is actually an interpretative language. Java source code is compiled to generate class files that can be executed by the JVMThe files generated by the Kotlin compiler can be recognized and executed by the JVM, so KT can still be executed in the same environment even if its syntax is very different from JavaKotlin is a simplifi ...

Posted by Jmz on Wed, 22 Sep 2021 07:34:16 -0700

Jetpack: Room database upgrade detailed actual combat!

Catalogue of series articles Related articles: Jetpack: Room super detailed use pit guide! Jetpack:Room+kotlin collaboration? Transaction problem analysis, detailed explanation of withTransaction API Jetpack:Room use error FAQ Jetpack:Room is optimized with LiveData/Flow, and Room+Flow uses principle analysis. Introduction to Room upg ...

Posted by falcon8253 on Sun, 19 Sep 2021 23:47:53 -0700