Other Times Your Application Is Called
The Palm OS makes a
distinction between communicating with the active application and
communicating with a possibly inactive application. In this first
case, the active application is busy executing an event loop and can
be communicated with by posting events to the event queue. As shown
in Hello World, this was how our application got closed; the
appStopEvent was posted to the event queue. When
the active application gets that event, it quits.
Because there are other times that your application gets called by the Palm OS, there needs to be a way to communicate with it in those instances. First, let’s look at a list of the circumstances under which the system might want to talk to your application:
When the user does a Find, the system must ask each installed application to look for any records that match the Find request.
When beamed data is received, the system must ask the appropriate application (the one that is registered to receive the data) to handle the incoming item.
When a synchronization occurs, each application is notified after its data has been synced.
After a reset, each application is notified that a reset has occurred.
If the system time or date changes, each application is notified.
If the country changes, each application is notified.
In all these cases, a communication must take place to an inactive or closed application. The question is how the system does this. The answer is launch codes; all these communications are handled ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access