Programming Android
|
Modules | |
Repeated refresh | |
XML configuration data | |
Checking next alarm time | |
In the following we use as a simple example an app widget which displays the next alarm time both as a notification on the lock screen and as a message on the home screen.
An app widget can be placed at any position of the home screen:
Typically the widget displays informations which may be updated from time to time. Additionally the widget may offer the possibility of interaction (e.g. a button click triggers a refresh). It is also possible to place several instances of the widget e.g. at different pages of the home screen.
As an app widget contains arbitrary application code which is regularly called by the operating system, these calls can also be used to update a notification message for the lock screen: