2

It seems that sometimes timeline items (just text) arrive instantly and other times they take forever... Is there a way to send one at precisely the right time?

ina
  • 19,167
  • 39
  • 122
  • 201

1 Answers1

2

You can send the notification at a precise time.

timelineItem.getNotification()
  .setDeliveryTime(new DateTime(oneMinuteInFuture.getTime()));

That's a java example, where oneMinuteInFuture is a Calendar object set to one minute after now.

What happens when you do this is the card is inserted in the timeline immediately, but the notification is delayed until the specified time. So the card goes in right away and one minute later I get a chime.

There is an unaccepted issue related to this at the issue tracker you might want to star and follow, it appears that this functionality might change in the future.

mimming
  • 13,974
  • 3
  • 45
  • 74
Mark Scheel
  • 2,963
  • 1
  • 20
  • 23
  • Is there a buffer period required for precise timing? What if it's sent within seconds of when it should show up? – ina Jun 14 '13 at 18:49
  • If the timeline card arrives at Glass after the deliveryTime, as of XE6, you will hear a chime upon arrival. You can test this by setting the deliveryTime to 1 minute in the past. Hope that answers your question. – Mark Scheel Jun 16 '13 at 16:51
  • There are several known issues that can cause this symptom where there is a delay between when your app pushes the item to the timeline and when the item actually shows up on the Glass. Some have been fixed, but not all, as delays still happen frequently for me. – derpface May 15 '14 at 20:36
  • @uberwulu can give us some pointers to where these issues are discussed. That would help to avoid them as much as possible. – dirkjot May 22 '14 at 13:47
  • @dirkjot: I didn't save any specific links as I've since abandoned the Mirror API in my current Glass development projects (for reasons unrelated to this), but you can find a lot of issues related to this symptom in the [Mirror API Issue Tracker](https://code.google.com/p/google-glass-api/issues/list). – derpface May 22 '14 at 17:18