Programming Android
 All Modules Pages
AppWidget - displaying information directly on the home screen

Modules

 Repeated refresh
 
 XML configuration data
 
 Refresh lock screen message
 
 Checking next alarm time
 

Detailed Description

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:

ScreenshotAppWidget.png

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:

ScreenshotLockScreen.png