Question

I'm developing a SmartWatch extension for my Android email app (Aqua Mail).

Something which was possible with the older LiveWare APIs, and which I can't find a way of doing with the new SmartWare APIs is:

... being able to pass a unique per-event opaque ID from my app to SmartWare, and to obtain it when processing user actions. There is a sourceId, but in my case that corresponds to a mail account, not an individual message.

The motivation is to implement message-specific actions, e.g. being able to mark an individual message "read" right from the SmartWatch, or to open it on the phone from the SmartWatch.

Was it helpful?

Solution

I am guessing you want to implement a Notification extension. To pass your own per-event ID, use the FRIEND_KEY column in the Event table. This is defined in Notification.EventColumns.FRIEND_KEY of the SmartExtensionAPI library.

You can also:

  • obtain the unique ID set by Smart Connect for the specific event
  • define your own set of actions to be performed on the events (up to three actions per source)

When the user reads the event on the SmartWatch, the event will be marked as read automatically, in the internal SmartConnect database. If the user chooses to perform an action on the event, by scrolling down and pressing the action, your extension will be notified about the action through the VIEW_EVENT_INTENT intent. The intent includes information about the event id, the source id, and the action that was chosen by the user. You can then obtain the FRIEND_KEY easily, and perform the action that you have defined.

Check out the SampleNotification extension that is contained in the Sony Add-on SDK, and there is also additional documentation about the Smart Extension APIs here.

Hope this helps, cheers!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top