public class Session
extends java.lang.Object
| 构造器和说明 |
|---|
Session(long foregroundTimeout,
long backgroundTimeout,
java.util.concurrent.TimeUnit timeUnit,
android.content.Context context)
Creates a new Session object which will
update itself overtime.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
checkAndUpdateSession()
Checks the current Session accessedTime and
determines whether the session id should be
incremented.
|
long |
getBackgroundTimeout() |
java.lang.String |
getCurrentSessionId() |
long |
getForegroundTimeout() |
java.lang.String |
getPreviousSessionId() |
SelfDescribingJson |
getSessionContext()
Returns the session context
|
int |
getSessionIndex() |
java.lang.String |
getSessionStorage() |
java.util.Map |
getSessionValues()
Returns the values for the session context.
|
java.lang.String |
getUserId() |
void |
setIsBackground(boolean isBackground)
Changes the truth of isBackground.
|
public Session(long foregroundTimeout,
long backgroundTimeout,
java.util.concurrent.TimeUnit timeUnit,
android.content.Context context)
foregroundTimeout - the amount of time that can elapse before the
session id is updated while the app is in the
foreground.backgroundTimeout - the amount of time that can elapse before the
session id is updated while the app is in the
background.timeUnit - the time units of the timeout measurementscontext - the android contextpublic SelfDescribingJson getSessionContext()
public void checkAndUpdateSession()
public void setIsBackground(boolean isBackground)
isBackground - whether the application is in
the background or notpublic java.util.Map getSessionValues()
public int getSessionIndex()
public java.lang.String getUserId()
public java.lang.String getCurrentSessionId()
public java.lang.String getPreviousSessionId()
public java.lang.String getSessionStorage()
public long getForegroundTimeout()
public long getBackgroundTimeout()