Posted by Ash Nohe and Amrit Sanjeev, Android Developer Relations Engineers
Practicing gratitude can reduce symptoms of depression and anxiety, and improve mental health and life satisfaction.1. Consistent gratitude practice can lead to sustained improvement over the months2. mindfulness app Thankfulness Encourages consistency through micro daily journaling, affirmations, and vision boards. The app has logged over 6 million downloads, 150 thousand 5-star ratings, and 100 million journal entries.
Developers Divij Gupta and Narendra Anjana developed widgets for each main user journey of their app. Their goal was to meet users in their everyday moments without requiring the overhead of a full app session.
By displaying interactive journaling prompts, affirmations, vision board images and metrics directly on the user’s home screen, the team lowered the barrier of entry for daily reflection and reported a 25% increase in retention for widget users and ~1K weekly journal entries from widgets. This increase in user loyalty translates into tangible health outcomes for users: consistent habit formation that supports long-term mental well-being.
“The widgets helped us make the app more present in users’ daily routines by providing quick inspiration, reminders, and reflections right on the home screen. This increased engagement and made it easier for users to stay consistent with their mindfulness practices.” – Divij Gupta
Challenge: Modernize without reducing retention
While the impact of widgets was obvious, Gratitude’s native XML-based RemoteView implementation created technical debt. As the app design system evolved toward Material 3, it became harder to align older widgets with the modern UI. Every visual update requires manual XML overhead and brittle workarounds, slowing down developers.
Solution Part 1: Migrating from XML to Jetpack Glance
To modernize its widgets, the team turned to jetpack look.
he consulted first widgets on android design pages and Canonical widget layout Understanding best practices for displaying information within a limited amount of space.
Then, they moved their widget suite to Jetpack Glance. This declarative framework enabled developers to move from planning to shipping in less than a month, saving approximately 50% of development time, and saw two additional benefits:
- Replacing restrictive XML layout with declarative code made the codebase easier to read, maintain, and reduced developer effort.
- Jetpack Glance allowed the team to more easily implement dynamic colorflexible resizeand extended configuration options. These features ensure that widgets harmonize with the user’s unique home screen layout.
The following GIF shows two gratitude widgets and adaptive sizes:
While Glance simplified the UI, the team noted that testing of different OEM launchers was also necessary to ensure layout consistency across different devices.
The team also implemented generated widget preview So that users can see personalized preview. He noted that testing the generated previews could be slow, as the preview rate is limited to conserve battery. To bypass rate limiting for testing, use the adb command:
adb shell device_config put systemui
generated_preview_api_reset_interval_ms 0
All their efforts resulted in a gratitude widget high quality and differentiated.
Solution Part 2: Promote New Widget to App
The developers then used In-App Widget Pinning To increase widget discoverability and widget installs. Asking users to install widgets at a contextually relevant moment within the app helps users find their widgets without needing to go through the system widget picker. The following GIF shows the bottom sheet of gratitude for adding the widget from within the app:
requestPinGlanceAppWidget Instantly inviting widget users to use the new modern widgets. developer tip: To retain widgets installed when migrating from Remote View to Jetpack Glance, make sure that your
GlanceAppWidgetReceiverUses your previous class name and package.AppWidgetProviderIn Android manifest. If a new class name or package location is needed, follow Gratitude’s lead by using in-app pinning to help users restore their widgets.
The strategy is working, e.g. 10% of total DAU Widgets have been adopted.
conclusion
This gratitude story shows that widgets can be tools for habit formation. By implementing quick actions to self-reflect directly from the home screen, the team improved user loyalty. Gratitude reduced technical debt and modernized its widgets by adopting Jetpack Glance, and encouraged users to add widgets to their apps.
“Our experience with Jetpack Glance has been excellent. The Compose-based approach feels more modern, flexible, and in line with the way we build the rest of our UI today. It allows us to express widget layouts more naturally, reuse familiar Compose components, and iterate on UI changes much faster. Many of the UI hurdles we previously encountered with Remote View are no longer an issue, making it easier to create widgets like these that better match the design and feel of our app.” – Divij Gupta
launch
To get started with Jetpack Glance and learn about the technologies mentioned in this post, check out these guides:
Check out other widget case studies:
1: Diniz, G., Korkes, L., Tristão, L.S., Pellegrini, R., Belodi, P.L., and Bernardo, W.M. (2023). Effects of gratitude interventions: A systematic review and meta-analysis. Einstein (São Paulo), 21, eRW0371. https://doi.org/10.31744/einstein_journal/2023RW0371
2: Bohlmeijer, E., Kraus, J., Schottnes-Dijkstra, M., and ten Klooster, P. (2022). Gratitude as mood mediates the effects of a 6-week gratitude intervention on mental well-being: Post hoc analysis of a randomized controlled trial. Front. Psychol., 12, 799447. https://doi.org/10.3389/fpsyg.2021.799447





