Developers
Local Navigation
-
Exercise
Write an application that registers a custom notification and a folder listener. The folder listener will activate the custom notification when an email arrives with a particular string in the subject of the email.
Objectives
- Discover how to make an application auto-start
- Discover how to register a folder listener
- Discover how to register a custom notification
- Discover how to monitor incoming email
Setup
- Download the file (ZIP)
- In the IDE, open the FolderListenerApp.jdw workspace
- Open the MessageNotification.java source file.
- Open the FolderListenerApp.java source file.
Tasks
- FolderListener Changes:
- Register the custom notification with the system
- Add a FolderListener to the store after it is retrieved
- Determine if the incoming message has been added to the INBOX folder
- Retrieve the subject of the new message
- Trigger the notification once it is discovered that the subject contains the string “< TAG >”.
- MessageNotification Changes:
- Register the consequence manager
Check Your Work
Download the completed code (ZIP)
Review
In this exercise, you discovered the following things:
- to make an application auto-start
- to register a folder listener and a custom notification
- to monitor incoming email
Additional Labs
Go to the first exercise in "Working with Multiple Processes and Threads", Listening for Pushed Data
Back to the Developer Lab Main Menu