I hear you don't understand the dependent task startup framework yet? I'll show you one
Author: Wang Chenyan
preface
When we are developing applications, we usually introduce SDKs, and most SDKs require us to initialize in the Application. When we introduce more and more SDKs, the Application will become longer and longer. If the initialization tasks of the SDK depend on each other, we have to deal with many condition judgment ...
Posted by AE117 on Tue, 22 Feb 2022 07:36:16 +0100
Pop! Pop! Give JobIntentService an injection, a big injection of Hilt, see if you're happy? Oh, I can't see the result.
0. Introduction Service
Service doesn't have to be used for a long time. Isn't it a long servant? We can use JobIntentService -- temporary servant. It's good to live and die with your App! However, it's easy to start and there's no clue to shut down. Because the service runs in the background, it has nothing to do with the UI. If we use MVVM, ...
Posted by johng on Sun, 20 Feb 2022 04:15:14 +0100
Kotlin advanced generic
We often use generics in Android development, such as List, Map, Set, Adapter, etc. generics are also supported in Kotlin. What is generics? Generics: special types that postpone the type specific work until the object is created or the method is called.
1, Defining generic methods in Kotlin
Defining generics in Kotlin is the same as Java in ...
Posted by mydog on Sat, 19 Feb 2022 15:11:00 +0100
Introduction to the basics of Kotlin language: Lambda expression
What is a Lambda expression?Lambda expressions are actually anonymous functions. In fact, a function is a function. An anonymous function is an anonymous function code. In Kotlin, function also appears as a type. Although in the current version, the flexibility of function type is not as flexible as Python, it can also be assigned and passed, w ...
Posted by Tjorriemorrie on Fri, 18 Feb 2022 21:28:01 +0100
kotlin implements the interface jump of registerForActivityResult mode
In the latest Android SDK, startActivityForResult has been marked as an outdated method, instead of using registerForActivityResult.
1. Why use registerForActivityResult? In the previous way of using startActivityForResult, you need to pass a requestCode. When the destination interface returns to this interface, you can use the requestCode to ...
Posted by BrianPeiris on Fri, 18 Feb 2022 02:54:56 +0100
Android kotlin material design technology points
1.Material design definition
Material design is a new set of interface design language developed by google design engineers based on excellent design principles and combined with rich creativity and science and technology, including visual, sports, interactive special effects and other characteristics.
2. Use of toolbar
Toolbar not only inhe ...
Posted by andymt on Sun, 13 Feb 2022 17:16:14 +0100
Kotlin grammar manual
Kotlin grammar manual (I)
When using kotlin, because the mastery is not reliable enough, it is still a habit of Java programming, which wastes the language features, convenience and indirectness provided by kotlin. When reading some Android open source libraries, it is difficult to read because many of them are written by kotlin syntax, and it ...
Posted by advancedfuture on Sat, 12 Feb 2022 07:26:33 +0100
Kotlin learning: 3.6 Classification of classes
Class modifier
Class modifiereffectfinalCannot be inherited from final classopenopen class that can be inheritedabstractabstract classenumEnumeration classdataData classsealedSealing classannotationAnnotation
abstract class
Use the abstract keyword to mark a class as abstract
abstract class Abstract class name[(primary constructor )][:I ...
Posted by Mew151 on Wed, 09 Feb 2022 14:18:33 +0100
Application guide and project practice of WorkManager of Android architecture components
Let's start with an introduction video of WorkManger: Chinese official introduction video (mainly because the little sister looks good ~)
Usage scenario
WorkManager is applicable to the needs that tasks need to continue to be executed after the application exits (such as the application data reporting server). For those cases that task ...
Posted by davidforbes on Mon, 07 Feb 2022 14:26:51 +0100
Android component design 3 -- advanced usage of kotlinpoet
As a means of generating code by annotation processor, kotlinpool generates Kotlin code in an object-oriented way, which is more in line with the design idea of designers than the write code line by line of EventBus
1. Basic syntax of kotlinpoet
First write a piece of Kotlin code
class testPoet{
companion object {
private const val ...
Posted by bradymills on Wed, 02 Feb 2022 03:41:59 +0100