SessionProvider

public abstract classSessionProviderextendsObject

An abstract base class for performing session construction. The SDK uses a subclass of SessionProvider to constructCastSession internally. If your app wants to support other types ofSession then you should subclass this class. Subclasses must implement createSession(String)and isSessionRecoverable(),which will be called by the Cast SDK during the lifecycle of the session. All methods must be called from the main thread.

Protected Constructor Summary

SessionProvider(Context applicationContext,Stringcategory)
Constructs a SessionProviderwith a category string.

Public Method Summary

abstractSession
createSession(StringsessionId)
Constructs a newSession.
finalString
getCategory()
Returns the category string for this SessionProvider.
finalContext
getContext()
Returns the applicationContext used to construct this instance.
abstract boolean
isSessionRecoverable()
Returnstrueif a previously constructed session can be resumed.

Inherited Method Summary

Protected Constructors

protectedSessionProvider(Context applicationContext,Stringcategory)

Constructs aSessionProvider with a category string. The category uniquely identifies aSession created by this provider.

Parameters
applicationContext The application Context of the calling app.
category The category string used to createSession.

Public Methods

public abstractSession createSession(StringsessionId)

Constructs a newSession. This method is called by the SDK to create a new session.

public finalStringgetCategory()

Returns the category string for thisSessionProvider.

public finalContext getContext()

Returns the applicationContext used to construct this instance.

public abstract boolean isSessionRecoverable()

Returnstrueif a previously constructed session can be resumed. Subclasses should check any persisted information about the previous session, such as a session ID, and return true only if it is possible to resume that session. This method is called by the SDK when it tries to resume a previously saved session.