Android offers several techniques for application to communicate with users with an Activity providing a direct UserInterface, for ex: Notifications, Toast.
- Toasts are a transient, non-modal Dialog-box mechanism used to display information to users without stealing focus from the active application.
- Notifications represent a more robust mechanism for alerting users. Many users, when they're not actively using their mobile phones, they sit silent and unwatched in pocket or on a desk until it rings, vibrates or flashes. Should a user miss these alerts. This case, status bar icons are used to indicate that an event has occurred. All of these attention-grabbing antics are available within Android as Notifications.
- Alarms provide a mechanism for fi ring Intents at set times, outside the control of your application lifecycle. An Alarm will fire even after its owner application has been closed, and can (if required) wake a device from sleep.
Creating and Controlling Service
Services is extended from Service base class. Services are designed to run in the background, so they need to be started, stopped and controlled by other application component.
Notes:
- Once you've contructed a new Service, you have to register it in the application manifest file within the service tag:
...
(... to be continuous...)
Ref:
- Pro Android June 2009
- Profession Android Application Development.
Không có nhận xét nào:
Đăng nhận xét