OnDataPointListener
Listener used to register to live data updates from a DataSource
.
Used by clients wanting to subscribe to live data stream updates via SensorsClient
.
Each event is delivered as a DataPoint
.
The listener is used both when
adding
a registration and when
removing
it. The same listener can be used for multiple registrations.
Public Methods
public abstract void onDataPoint (DataPoint
dataPoint)
Handle a new data point from the data source. The data point's data
type
describes the format and meaning of its values.
Note: The application doesn't own the data point object passed as a parameter
after this method returns and therefore should not hold on to it, since the DataPoint
can be reused by the platform.
Parameters
dataPoint |
The data point for this event. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["`OnDataPointListener` enables apps to receive live data updates from a `DataSource` via the `SensorsClient`."],["It's used for both registration and removal of data stream subscriptions."],["The `onDataPoint` method is triggered when a new data point is received, providing data in a `DataPoint` object."],["Apps should not retain the `DataPoint` object passed to `onDataPoint` as it's reused by the system."]]],["The `OnDataPointListener` interface registers for live data updates from a `DataSource` via `SensorsClient`. Clients use it to subscribe and receive `DataPoint` events. The same listener can manage multiple registrations. The `onDataPoint` method handles new data points, providing their format and meaning through the `DataType`. Applications must not retain the received `DataPoint` object.\n"]]