Simple example of creating a service backed widget in Android.
vCat example application (with source code – see below) that implements a simple widget and service.
If you ignore that cat widget, it becomes needy and meows. If you pet the cat, it purrs.
vCat is a home screen widget only and not a regular application, you will need to add it to your home screen for it to do anything.
You can find the source and tutorial here:
See more information and download apk file for your android phone: googleplaystoreapks.com/category/libraries-demo