Android development: UI toolkit Jetpack Compose works with current Kotlin

For faster releases, the toolkit for declarative user interface development relies on incremental updates with independently versioned libraries.

 Android development: UI toolkit Jetpack Compose works with current Kotlin

One year after the first stable release version 1.2 of the compiler library of Jetpack Compose has now been released. Meanwhile, the toolkit’s other libraries will continue to run in the 1.1 release. Google decouples the versioning to be able to roll out updates incrementally.

Interaction with Kotlin

The compiler library gets an update before the other parts of the toolkit in order to be compatible with the current Kotlin release 1.7, which was released in early June after a five-week beta period. The Kotlin programming language developed by JetBrains has been the official alternative to Java for developing Android apps since 2017 and the first choice for the mobile operating system since 2019.

Compose is closely tied to Kotlin, and obviously there was there are numerous requests from the developer community to provide current language releases for the UI toolkit in a timely manner. Therefore, the compiler library releases should appear more frequently than the feature updates in the other libraries.

The Compose compiler works as a plugin for the Kotlin compiler. In order to use the current version 1.2, the following entry is required in build.gradle:

android { composeOptions { kotlinCompilerExtensionVersion = “1.2.0” }}

Compiled appropriately

With the decoupling, the individual libraries are forward and backward compatible with each other. For the interaction with the programming language, a list on the Android developer site shows the compatibility of the respective versions of the compose compiler with Kotlin.

Further updates of the individual compose libraries are planned in the coming weeks, which will probably bring adjustments and additions to the UI elements, such as version 1.1 of the toolkit in February.

Describe surfaces instead of drawing

Google released Jetpack Compose in the stable version 1.0 at the end of July 2021 released. The UI toolkit for Android follows a declarative approach and relies on the Kotlin programming language and a reactive programming model. So-called composable functions define the individual control elements – or parts of them.

 Android development: UI toolkit Jetpack Compose works with current Kotlin

Functions decorated with @Composable can be nested within each other to ultimately create the interface. The code describes the basic look of the interface, and under the hood the toolkit takes care of the implementation in the UI tree structure and updating the content.

More details on the decoupling of the libraries and the 1.2 release of the Compiler library can be found on the Android Developer Blog.

@top-advice.ru

Rate article
TOP ADVICE
Leave a Reply