Jetpack Glance Part3: Create widget

AndroidAI
13 min readJan 25, 2022

Recently the Android team released the alpha version of Jetpack Glance. I wrote an article about

Please read these articles

In this article, I am going to tell you how to create an app widget using Jetpack glance. Let's start...

Initial Setup

If you want to try Jetpack glance there are some steps. First of all, we should add the Glance dependencies into our build.gradle file.

dependencies {
implementation "androidx.glance:glance-appwidget:1.0.0-alpha01"
}

Since Glance is based on the compose framework, compose will need to be enabled for the project.

android {
buildFeatures {
compose true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.2.0-alpha01"
kotlinCompilerVersion '1.6.10'
}
}

That’s all in the dependency part. Let us jump into the coding part.

--

--