It has been many days since our last (Not Quite) Daily Tutorial™. But we're back with Palm Synergy Services; a very cool feature that allows you to do some neat tricks with applications, such as automatically inserting an event in your calendar after you've performed an action like making a dinner reservation or buying tickets for a concert. Palm Synergy Services support integration with the Synergy applications which currently include Contacts, Calendar, Email and Messaging. Palm suggests that other applications "could be supported over time", which leaves hope for integration with other apps like Tasks and Memos.
Email and Messaging are launched through the Application Manager service and can be used to send messages with the user's approval, similar to the way the Phone application works (the application launches with information provided from the calling application, but the user must still press "send"). Contacts and Calendar services enable applications to work more directly with contact data or calendar events, although Palm suggests these services are designed for "occasional use" to add single records rather than "full sync" solutions.
Operations that add data to Synergy applications (e.g. adding an event to a user's calendar) require an established Synergy Account before any other operations can take place. There is an implicit "Palm" account that all information created and stored on the device belongs to, but other information must be provided by an application with an explicit account id. Data that belongs to an account can only be accessed by the application that owns that account.
A good example of this is the third-party�Missing Sync�application. It enables you to pull data from iCal on a Mac into the Palm's calendar application (among other things). To do this, the Missing Sync application creates its own calendar "account", which is then listed when you go into the calendar application on the Pre (it's the last one with the firstname.lastname@example.org email):
However, all of the data in this account is mingled with the other calendar data when the user views their calendar, so it's a seamless "Synergy" experience. All of the data added to your calendar through the Missing Sync is associated with this account. Deleting the account from the calendar would delete all of the events added to your calendar through the Missing Sync application. Similarly, deleting the Missing Sync application from your device would probably also result in the Missing Sync accounts and associated information being deleted from your device.
The Account Manager service provides methods to create, update, delete, read and list accounts.
If your application only occasionally needs to add a contact or calendar event, Palm suggests accounts may be a lot of unnecessary overhead and you may instead choose to simply launch the Contacts or Calendar application and have the user enter their data directly. In the screenshot above, you can see an account created by the Flixster application; I have not yet used that application so the account sits there in the event that I actually use the application to buy movie tickets.
Contacts & Calendar
Contacts and Calendar allow applications to add information that will get merged into an integrated view for the end user.
The Contacts application has methods to create, read, update, delete and list contacts (in the account belonging to the application). There are also methods to track changes to contacts to support applications that want to optimize updating their data sources when the user changes a record.
The Calendar application requires that a calendar be first created in which to place events. There are also methods to track changes to or deletions of calendar events.
The People Picker is a special contacts function that enables applications to display a list of all contacts on the device and allow the user to select a contact whose details will then be transferred to the requesting application. This allows applications to interact with the full list of contacts on the device while still keeping data access secure. An example usage could be emailing a link to a product to a friend, or using a friend's birth date to schedule an event.
The People Picker is called through a Cross-App launch. This technique pushes a scene from another application on your application's scene stack. This keeps your application context, meaning that the user won't see a card switch.
Email and Messaging
You can launch the Email and Messaging applications using the Application Manager launch method, but most applications would probably benefit from a more integrated approach, using the application only to send a message. You can launch the application in a compose view and even pre-populate some or all of the fields.
That does it for Mojo's Synergy Services. In our next (not quite) daily tutorial series, we'll be covering Viewers and Players! Follow us on Twitter or grab the webOShelp.net RSS feed to stay in the know.
Much of the information in this article was presented in Chapter 8 of Palm webOS by Mitch Allen.