Jetpack Compose is the latest recommended tool by Google to build Android Apps is based on composable functions. These composable are used to draw UI of Android Apps programmatically. In jetpack Compose @composable annotation is used with the function name inside it we can add elements such as text, image, button cards etc.
In the following example we create a composable function named FirstScreen in which I added a Text and Image inside a column.
@Composable
fun FirstScreen(innerPadding: PaddingValues) {
Column (Modifier.padding(60.dp)){
Text(text = "Hello Compose!")
Image(
painter = painterResource(R.drawable.profile_pic),
contentDescription = "Contact profile picture",
)
}
}
Modifier: is used to change the composable size, layout, behavior, and appearance.
Padding: padding puts space around an element.
FillMaxWidth: fillMaxWidth makes the composable fill the maximum width given to it from its parent.
OUTPUT:
The @Preview annotation is used to see the review of the UI. The following is the example of preview annotation.
@Preview(showBackground = true)
@Composable
fun PreviewUi() {
FirstScreen(modifier = PaddingValues())
}
About the Author
Sandeep Kumar is an Android developer and educator who writes beginner-friendly Jetpack Compose tutorials on CodingBihar.com. His focus is on clean UI, Material Design 3, and real-world Android apps.
Coding Bihar
Jetpack Compose Tutorial
Android
All Android development tutorials
Jetpack Compose
Modern UI toolkit for Android
Material Design
UI components and design guidelines
Kotlin Multiplatform
Share code across platforms
PDF Courses
Downloadable study materials
CBSE Class 10
Complete syllabus and notes
CBSE Class 11
Concepts, examples and practice
CBSE Class 12
Board exam focused content
CBSE 10 Math
Formulas, solutions and tricks
CBSE 11 Math
Algebra, calculus and practice
CBSE 12 Math
Exam-oriented problem solving
Web Development
HTML, CSS, JavaScript and Responsive Design.
Python Programming
Beginner to advanced Python tutorials.
SkillDedication
— Python High Level Programming Language- Expert-Written Tutorials, Projects, and Tools—

