| java.lang.Object | |
| ↳ | com.google.android.gms.fitness.SensorRequest |
Request for registering for real time updates from a data source. Use this
request to specify the data source or data type to register to, the sampling rate,
the fastest reporting interval, and the maximum desired delivery latency. Example usage:
new SensorRequest.Builder()
.setDataType(DataTypes.HEART_RATE_BPM)
.setSamplingRate(10, TimeUnit.SECONDS) // sample every 10s
.build();
An app can register to either public data sources/types or custom data sources/types created by
itself. Registration to custom data source/type created by another app is not permitted.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| SensorRequest.Builder | Builder used to create new SensorRequests. | ||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | ACCURACY_MODE_BALANCED | An Accuracy Mode representation that balances accuracy of data collection and battery usage. | |||||||||
| int | ACCURACY_MODE_HIGH | An Accuracy Mode representation that indicates that the application requires high accuracy data and expects the extra battery usage. | |||||||||
| int | ACCURACY_MODE_LOW | An Accuracy Mode representation that indicates that the application requires low accuracy data, improving battery life. | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns a SensorRequest for location updates corresponding to the given LocationRequest.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
An Accuracy Mode representation that balances accuracy of data collection and battery usage.
An Accuracy Mode representation that indicates that the application requires high accuracy data and expects the extra battery usage.
An Accuracy Mode representation that indicates that the application requires low accuracy data, improving battery life.
Returns a SensorRequest for location updates corresponding to the given LocationRequest.
| dataSource | The DataSource that will provide location. |
|---|---|
| locationRequest | Request defining parameters for location updates. |