Creating Widgets With Jetpack Compose Glance

Daniel Atitienei
3 min readJul 25, 2023

Hey fellas! Take your cup of coffee ☕️ and let’s create a contact list widget using Jetpack Glance provided by Google.

What is Glance?

Jetpack Glance is a framework for creating small, lightweight, and efficient app widgets using Kotlin APIs. It is designed to be used for displaying information that users need to know at a glance.

What we will build?

As I mentioned in the beginning we will build a contact list widget. Here is how it will look.

Setup

Let’s add the dependencies in your app’s module based on the features you need.

dependencies {
// For AppWidgets support
implementation("androidx.glance:glance-appwidget:1.0.0-beta01")

// For interop APIs with Material 2
implementation("androidx.glance:glance-material:1.0.0-beta01")

// For interop APIs with Material 3
implementation("androidx.glance:glance-material3:1.0.0-beta01")
}

Creating the ContactListWidget

--

--