java.lang.Object | |
↳ | com.google.android.gms.fitness.request.SessionInsertRequest |
A request for inserting a Session
and associated DataSet
and/or aggregated
DataPoint
into the Google Fit store. Useful when data is read from a data source outside
of Google Fit, or when inserting batch historical data.
The request cannot have a continuing session, i.e. session should have valid start and end times. Request may contain multiple data sets and multiple aggregated data points.
The Builder will enforce that each data set or aggregated data point represents a unique
DataSource
. The Builder will also enforce that timestamps of the data specified are
consistent with session start and end times. For all data points specified in the data set(s),
the timestamps should fall between the session start and end times. And for all aggregate data
points, the start and end time timestamps should fall between the session start and end times.
Example usage:
Session session = new Session.Builder() .setName(sessionName) .setIdentifier(identifier) .setDescription(description) .setStartTime(startTime.getMillis(), TimeUnit.MILLISECONDS) .setEndTime(endTime.getMillis(), TimeUnit.MILLISECONDS) .build(); SessionInsertRequest request = new SessionInsertRequest.Builder() .setSession(session) .addDataSet(dataSet) .addAggregatedDataPoint(dataPoint) .build();Apps can only add data for public data types or custom data types created by itself. Data of custom data type created by another app cannot be added.
Nested Classes | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SessionInsertRequest.Builder | Builder used to create new SessionInsertRequest. |
[Expand]
Inherited Constants | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]()
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the aggregate data points we are inserting.
| |||||||||||
Returns the data sets we are inserting.
| |||||||||||
Returns the session we are inserting.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||||||||||||||||||||||||
![]() |
Returns the aggregate data points we are inserting.
Returns the data sets we are inserting.