VOOZH about

URL: https://www.geeksforgeeks.org/kotlin/text-clock-in-android-using-jetpack-compose/

⇱ Text Clock in Android using Jetpack Compose - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Text Clock in Android using Jetpack Compose

Last Updated : 23 Jul, 2025

Text Clock is a UI widget in android which is used to display the current time in android applications. This widget displays the current time in a simple text view. The text clock widget displays a time in 12 and 24 hours format. In this article, we will take a look at How to use the TextClock widget on android using Jetpack Compose

Step by Step Implementation

Step 1: Create a New Project in Android Studio

To create a new project in the Android Studio, please refer to How to Create a new Project in Android Studio with Jetpack Compose.

Step 2: Working with the MainActivity.kt file

Go to the MainActivity.kt file and refer to the following code. Comments are added inside the code to understand the code in more detail.

In this file, we will be using the AndroidView composable to integrate the xml view, TextClock in compose.

MainActivity,kt:

Output:

Comment
Article Tags:

Explore