Jetpack Compose technology innovation is mobile application development that moves very fast. In recent years, declarative UI and reactive programming have become a trend that is quite dominant in the news in the mobile world. In making Android applications, of course the UI is one of the important parts that can even determine whether or not the user feels at home when using the application. On Android itself, it natively uses XML for UI creation. This is considered quite inconvenient, especially when required to handle complex designs. The Android team at Google also knew about this and finally provided a solution in the form of Jetpack Compose.
Articles About Engineering and Computer ScienceAlso Read: Other Articles
Jetpack Compose uses a declarative approach that is not the same as imperative approaches such as creating UIs with XML. The concept of the UI system in Jetpack Compose is composable or composition, meaning that each UI component can be stacked into a parent and child in it. Furthermore, Jetpack Compose is Android’s modern toolkit for creating native UIs. Jetpack Compose simplifies and speeds up UI development on Android with less code, powerful tools, and intuitive Kotlin APIs. Jetpack Compose is built based on compose functions. This function makes it possible to define an application’s UI programmatically by describing the appearance and provision of data dependencies, instead of focusing on the UI construction process (starting elements, attaching them to the parent, etc.). To build a composable function, simply add the @Composable annotation to the function name. According to Google, the four main advantages as well as the main advantages when using Jetpack Compose are:
Computer Engineering Study Program Faculty of Engineering and Computer Science – Universitas Teknokrat IndonesiaInformasi Program Studi Teknik Komputer Selengkapnya Disini
Apps that use Jetpack Compose are made of functions called Composable Functions. The structure itself is like a function in the Kotlin language in general, except that it is marked with the @Composable annotation, which can also call other composable functions. The annotation will tell Compose to provide specific support for the functionality, such as to update the UI when a state change occurs. Composable functions are usually called “composable” just to make it shorter. In general, the UI of an app is made up of various composables, just as the UI of an app is made up of Widgets in Flutter. For more details about the concept of composable can see the image below.
In the image above you can see that UI Components can be stacked on top of each other. The above composable represents every function that has a @Composable annotation, then in that function you can call another @Composable function in it.