public static class

Session.Builder

extends Object
java.lang.Object
   ↳ com.google.android.gms.fitness.data.Session.Builder

Class Overview

Builder used to create new Sessions.

Summary

Public Constructors
Session.Builder()
Public Methods
Session build()
Finishes building and returns the session.
Session.Builder setActivity(int activity)
Sets the activity associated with this session.
Session.Builder setDescription(String description)
Sets a description for this session.
Session.Builder setEndTimeMillis(long endTimeMillis)
Sets the end time of the session.
Session.Builder setIdentifier(String identifier)
Sets the identifier for this session.
Session.Builder setName(String name)
Sets the a human readable name of the session.
Session.Builder setStartTimeMillis(long startTimeMillis)
Sets the start time of the session.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Session.Builder ()

Public Methods

public Session build ()

Finishes building and returns the session.

Throws
IllegalStateException if the builder doesn't have enough state to create a valid request

public Session.Builder setActivity (int activity)

Sets the activity associated with this session. The specified activity value should be one of the recognized FitnessActivities. If an unrecognized value is specified, or if not specified, the activity for the session is set to UNKNOWN.

public Session.Builder setDescription (String description)

Sets a description for this session.

public Session.Builder setEndTimeMillis (long endTimeMillis)

Sets the end time of the session. If end time is not specified, session is considered to be still ongoing.

Parameters
endTimeMillis an end time, in milliseconds since epoch, inclusive

public Session.Builder setIdentifier (String identifier)

Sets the identifier for this session. Must be unique for the client application.

public Session.Builder setName (String name)

Sets the a human readable name of the session.

public Session.Builder setStartTimeMillis (long startTimeMillis)

Sets the start time of the session.

Parameters
startTimeMillis a start time, in milliseconds since epoch, inclusive