Receiving data occurs until the event listener is unset.
private final HealthTracker.TrackerEventListener trackerListener =
new HealthTracker.TrackerEventListener() {
@Override
public void onDataReceived(List<DataPoint> list) {
}
@Override
public void onError(HealthTracker.TrackerError error) {
// Error occurs..
}
@Override
public void onFlushCompleted() {
// Flushing data is completed.
}
};
If you get SDK_POLICY_ERROR, it indicates that your app’s SDK policy was not downloaded yet.
NoteAlthough frequency of data is fixed (for example, for the accelerometer, it’s 25 Hz), interval time between each DataPoint’s timestamp in TrackerEventListener.onDataReceived() may vary. The order of received data points is not changed, and handles the received data in order, regarding timestamp differences. See Data Specifications).
Flushing data
If a watch’s display is off, Health Platform provides batched tracking data. flush() gives the collected data instantly.
protected final void flushHeartRate() {
// Flushing data gives collected data instantly.
heartRateContinuousTracker.flush();
}
For example, tracking continuous heart rate normally gives 600 samples every 10 minutes.
If flush() is called when 25 samples have been gathered, a DataPoint list in onDataReceived() gives only 25 samples.
After getting the flush result, onDataReceived() again provides another 600 samples after a 10 minites period.
Stop tracking
If your app doesn’t need to track data anymore, unset the registered event listener with:
protected final void stopTracking() {
// Unsetting the event listener stops tracking data.
ppgContinuousTracker.unsetEventListener();
}
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
developer.samsung.com, .samsung.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
Samsung Electronics
.samsung.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
Samsung Electronics
developer.samsung.com, google.account.samsung.com
Preferences Submitted
You have successfully updated your cookie preferences.