Posted by Ash Nohe and Amrit Sanjeev, Android Developer Relations Engineers
Practicing gratitude may decrease symptoms of depression and anxiety, and improve mental health and life satisfaction1. Consistent gratitude practice may lead to sustained improvements that last months2. The mindfulness app Gratitude encourages consistency through micro daily journaling, affirmations, and vision boards. The app has over 6 million downloads, 150 thousand 5-star ratings, and 100 million journal entries logged.
Developers Divij Gupta and Narendra Aanjna developed widgets for each of their app’s core user journeys. Their goal was to meet users in their everyday moments without requiring the overhead of a full app session.
By surfacing interactive journaling prompts, affirmations, vision board images and metrics directly on the user’s home screen, the team lowered the barrier to 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 to tangible health outcomes for the users: consistent habit formations that support long-term mental well-being.
“Widgets helped us make the app more present in users’ daily routines by providing quick inspiration, reminders, and reflections directly on the home screen. This increased engagement and made it easier for users to stay consistent with their mindfulness practices.” – Divij Gupta
The Challenge: modernize without decreasing retention
While the impact of widgets was clear, Gratitude’s original XML-based RemoteViews implementation created technical debt. As the app’s design system evolved toward Material 3, the legacy widgets became increasingly difficult to align with the modern UI. Every visual update required manual XML overhead and brittle workarounds, slowing developer velocity.
The Solution Part 1: migrating from XML to Jetpack Glance
To modernize their widgets, the team turned to Jetpack Glance.
They first consulted the Widgets on Android design page and canonical widget layouts to understand best practices for displaying information within a limited amount of space.
Then, they migrated their widget suite to Jetpack Glance. This declarative framework enabled the developers to move from planning to shipping in less than a month, saving about 50% development time, and saw two additional advantages:
- Replacing restrictive XML layouts with declarative code made the codebase easier to read, maintain, and reduced developer effort.
- Jetpack Glance allowed the team to more easily implement dynamic colors, flexible resizing, and expanded configuration options. These features ensure the widgets harmonize with a user’s unique home screen layout.
The following GIF shows two Gratitude widgets and adaptive resizing:
While Glance simplified the UI, the team noted that testing across various OEM launchers was also essential to ensure layout consistency across devices.
The team also implemented Generated Widget Previews so users can see personalized previews. They noted that testing Generated Previews could be slow, as the previews are rate limited to preserve battery. To bypass the rate limiting for testing, use the adb command:
adb shell device_config put systemui
generated_preview_api_reset_interval_ms 0
All of their efforts have made the Gratitude widget high quality and differentiated.
The Solution Part 2: promote new widgets in-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 Gratitude’s bottom sheet to add widgets from within the app:
requestPinGlanceAppWidget prompt inviting widget users to use the new modernized widgets. Developer Tip: To maintain widget installs while migrating from RemoteViews to Jetpack Glance, ensure your
GlanceAppWidgetReceiveruses the same class name and package as your previousAppWidgetProviderin the Android Manifest. If a new class name or package location is required, follow the Gratitude’s lead by using in-app pinning to help users restore their widgets.
The strategy is working, as 10% of total DAU have adopted widgets.
Conclusion
This Gratitude story shows that widgets can be tools for habit formation. By implementing quick actions to self-reflect right from the home screen, the team may have improved user loyalty. Gratitude reduced technical debt and modernized their widgets by adopting Jetpack Glance, and prompted users to add widgets within their app.
“Our experience with Jetpack Glance has been excellent. The Compose-based approach feels much more modern, flexible, and aligned 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 constraints we previously faced with RemoteViews are no longer an issue, which made it easier to build widgets that better match our app’s design and experience.” – Divij Gupta
Getting Started
To get started with Jetpack Glance and learn about the technologies mentioned in this post, see these guides:
See other widget case studies:
1: Diniz, G., Korkes, L., Tristão, L. S., Pelegrini, R., Bellodi, P. L., & Bernardo, W. M. (2023). The effects of gratitude interventions: a systematic review and meta-analysis. einstein (Sao Paulo)., 21, eRW0371. https://doi.org/10.31744/einstein_journal/2023RW0371
2: Bohlmeijer, E., Kraiss, J., Schotanus-Dijkstra, M., & ten Klooster, P. (2022). Gratitude as mood mediates the effects of a 6-weeks 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




