FitnessSensorServiceRequest | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Constants | Inherited Constants | Fields | Methods | Inherited Methods | [Expand All]
public class

# FitnessSensorServiceRequest

extends Object
implements Parcelable

java.lang.Object
↳ | com.google.android.gms.fitness.service.FitnessSensorServiceRequest

## Class Overview

Request for registering for sensor events from an application-exposed sensor `data source`. The request specifies the data source, the desired sampling rate and batching interval for the registration, and a listener to deliver events to.

## Summary

Constants
int | UNSPECIFIED | Constant representing an unspecified value.

[Expand] Inherited Constants
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Fields
public static final Creator<FitnessSensorServiceRequest> | CREATOR |

Public Methods
int | describeContents()
boolean | equals(Object that)
long | getBatchInterval(TimeUnit timeUnit) Sets the maximum delay between a data point being detected and reported.
DataSource | getDataSource() Returns the data source the client is registering to.
SensorEventDispatcher | getDispatcher() Returns a dispatcher that can be used to send events back to the Fitness Platform for this particular registration.
long | getSamplingRate(TimeUnit timeUnit) Returns the desired delay between two consecutive collected data points, in the given time unit.
int | hashCode()
String | toString()
void | writeToParcel(Parcel parcel, int flags)

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Constants

#### public static final int UNSPECIFIED

Constant representing an unspecified value.

Constant Value: -1 (0xffffffff)

## Fields

#### public static final Creator<FitnessSensorServiceRequest> CREATOR

## Public Methods

#### public int describeContents ()

#### public boolean equals (Object that)

#### public long getBatchInterval (TimeUnit timeUnit)

Sets the maximum delay between a data point being detected and reported. The batch interval can be used to enable batching, which can save battery by reducing the number of times the AP is awaken, and the number of network transfers. This is specially important if the sensor exposed is from a companion device.

The batch interval is a hint to the system, and events can be reported sooner. If no interval is specified, or if the underlying data source does not support batching, events may be reported as soon as they are detected.

##### Returns

- the maximum latency, in micros, or `UNSPECIFIED` if unspecified.

#### public DataSource getDataSource ()

Returns the data source the client is registering to. The Fitness Platform will guarantee that applications only receive requests for data sources they own.

Duplicate requests for the same data source should be treated as update requests.

#### public SensorEventDispatcher getDispatcher ()

Returns a dispatcher that can be used to send events back to the Fitness Platform for this particular registration.

#### public long getSamplingRate (TimeUnit timeUnit)

Returns the desired delay between two consecutive collected data points, in the given time unit. This is only a hint, and events may be sampled faster or slower than the specified rate.

If the sampling rate is unspecified, the application should select a default rate with conservative battery usage for an always-on registration.

##### Returns

- the sampling rate, in the specified unit, or `UNSPECIFIED` if unspecified.

#### public int hashCode ()

#### public String toString ()

#### public void writeToParcel (Parcel parcel, int flags)