java.lang.Object |
↳ |
com.google.android.gms.fitness.request.SessionReadRequest |
Class Overview
Request for reading Session
data from Google Fit.
Use this request to specify the sessions to read, as well as
data sets
that should be read for each session.
Example usage for reading all sessions during a time interval, as well as location data points
for each session:
new SessionReadRequest.Builder()
.setTimeInterval(startTime.getMillis(), endTime.getMillis(), TimeUnit.MILLISECONDS)
.read(DataTypes.LOCATION_SAMPLE)
.build();
A valid time interval is mandatory for the request. Session name and identifier are optional
fields that can be used to further filter out the returned result.
By default, only sessions created by the calling app will be returned. To get sessions created
by other apps, use
readSessionsFromAllApps()
}
An app can only read public data types or custom data created by itself. Custom data types
created by another app cannot be read.
Summary
Nested Classes |
class |
SessionReadRequest.Builder |
Builder used to create a new SessionReadRequest. |
[Expand]
Inherited Constants |
From interface
android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
|
Public Methods |
boolean
|
equals(Object o)
|
List<DataSource>
|
getDataSources()
Returns the data sources to be read in this request.
|
List<DataType>
|
getDataTypes()
Returns the data types for which default data sources should be read in this request.
|
long
|
getEndTime(TimeUnit timeUnit)
Returns the end time for our query, in the given time unit
|
List<String>
|
getExcludedPackages()
Returns any app package names that were excluded from the request.
|
String
|
getSessionId()
Returns the session id we are requesting data for.
|
String
|
getSessionName()
Returns the session name we are requesting data for.
|
long
|
getStartTime(TimeUnit timeUnit)
Returns the start time for our query, in the given time unit
|
int
|
hashCode()
|
boolean
|
includeSessionsFromAllApps()
Returns true if the read data should include sessions from other apps.
|
String
|
toString()
|
void
|
writeToParcel(Parcel dest, 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(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
android.os.Parcelable
abstract
int
|
describeContents()
|
abstract
void
|
writeToParcel(Parcel arg0, int arg1)
|
|
Fields
Public Methods
public
boolean
equals
(Object o)
public
List<DataSource>
getDataSources
()
Returns the data sources to be read in this request.
Returns |
List<DataSource> |
the specified data sources, empty if none
|
public
List<DataType>
getDataTypes
()
Returns the data types for which default data sources should be read in this request.
Returns |
List<DataType> |
the specified data types, empty if none
|
public
long
getEndTime
(TimeUnit timeUnit)
Returns the end time for our query, in the given time unit
Parameters |
timeUnit |
TimeUnit
|
public
List<String>
getExcludedPackages
()
Returns any app package names that were excluded from the request.
Returns |
List<String> |
the list of excluded packages, empty if none
|
public
String
getSessionId
()
Returns the session id we are requesting data for.
Returns |
String |
the specified session identifier, or null if unspecified
|
public
String
getSessionName
()
Returns the session name we are requesting data for.
Returns |
String |
the specified session name, or null if unspecified
|
public
long
getStartTime
(TimeUnit timeUnit)
Returns the start time for our query, in the given time unit
Parameters |
timeUnit |
TimeUnit
|
public
boolean
includeSessionsFromAllApps
()
Returns true if the read data should include sessions from other apps.
public
String
toString
()
public
void
writeToParcel
(Parcel dest, int flags)
Parameters |
dest |
Parcel
|
flags |
int
|