问题
I am trying to retrieve my sleep data in REAL TIME. I cannot find how to achieve it from docs: UP Platform Android SDK
P.S. : I am willing to conduct sleep experiment that requires getting an event when I reach e.g. paradoxal sleep phase. Thanks!
回答1:
Using the UP APIs, the closest you can get to real time updates is to have your application register for PubSub event notifications for sleep events:
There are two limitations that will keep these event notifications from occurring exactly in real-time:
- PubSub events are only triggered when the band syncs data to the phone.
- PubSub sleep events are only triggered for a complete sleep and not for individual phases.
Regarding #1, the band (UP24 and newer) must have an active bluetooth connection with the phone and then syncs will usually occur within 15 minutes.
For #2, calculation of the different sleep phases currently requires reviewing the band data for the entire sleep event, so the API cannot send individual event notifications for phase changes.
来源:https://stackoverflow.com/questions/37799916/up3-jawbone-how-to-retrieve-sleep-value-in-realtime