Search code examples
androidandroid-widgetandroid-jetpack-compose

Can Jetpack Compose be used to build App Widgets?


With swift, widgets can be written using SwiftUI, but I have not seen any statements regarding whether Jetpack Compose can be used to build Android App Widgets.

Is there any information where I can see how that can be done now that Compose is in Alpha?


Solution

  • You can use AndroidX's Glance, which is now an Alpha release:

    https://developer.android.com/jetpack/androidx/releases/glance

    You can find an example code project here:

    https://github.com/android/user-interface-samples/tree/glance/AppWidget/glance-widget