Writing an App Widget

In 2020, iOS finally added support for app widgets, a capability that Android has had for over a decade. Since iOS tends to have a big influence in app design and feature decisions, interest in app widgets on Android is likely to increase. So, in this chapter, we will explore what it takes to write an app widget.

Writing a… What?

“App widgets” are interactive elements that can be added to a home screen. While some things that appear like app widgets are actually features of the launcher app, true app widgets are ones that can be published by apps such as yours.

Users can add app widgets to their home screen as they see fit, typically via a long-click on the wallpaper or home screen background.

Sample Home Screen Long-Press Menu
Sample Home Screen Long-Press Menu

Choosing “Widgets” from that particular home screen menu brings up a chooser of available app widgets:

Sample App Widget Chooser
Sample App Widget Chooser

The user can then drag and drop the app widget to the home screen. Usually, the user can long-press on the app widget to be able to resize or remove it from the home screen.

For most apps, the idea behind app widgets is to make key bits of information or key actions available to the user just from the home screen, without having to switch to your app’s full UI.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.