Connect Android SDK: lifecycle and session management
The page describes additional methods available in the Connect Android SDK.
Platform: Android 8-16
Languages: Kotlin and Java
Declared in: Connect
App
Connect.setApplication
Connect.setApplicationSets the application context.
Connect.setApplication(app: Application)Parameters:
app(required) — The hostApplicationinstance.
Connect.getApplication
Connect.getApplicationReturns the application context.
Connect.getApplication(): Application?Connect.isApplicationInBackground
Connect.isApplicationInBackgroundReturns true if the application is in the background.
Connect.isApplicationInBackground(): BooleanConnect.hasBeenPostedInBackground
Connect.hasBeenPostedInBackgroundReturns true if the library posted messages while the application was in the background.
Connect.hasBeenPostedInBackground(): BooleanActivity and fragment lifecycle
Connect.onResume
Connect.onResumeNotifies the library that an activity has resumed. Call from your activity's onResume().
Connect.onResume(
activity: Activity?,
logicalPageName: String?
): BooleanParameters:
activity(required) — The activity that resumed.logicalPageName(required) — The logical name of the screen.
Connect.onPause
Connect.onPauseNotifies the library that an activity has paused. Call from your activity's onPause().
Connect.onPause(
activity: Activity?,
logicalPageName: String?
): BooleanParameters:
activity(required) — The activity that paused.logicalPageName(required) — The logical name of the screen.
Connect.onResumeFragment
Connect.onResumeFragmentNotifies the library that a fragment has resumed.
Connect.onResumeFragment(
activity: Activity?,
logicalPageName: String?,
fragment: Any?
): BooleanParameters:
activity(required) — The host activity.logicalPageName(required) — The logical name of the fragment.fragment(required) — The fragment that resumed.
Connect.onPauseFragment
Connect.onPauseFragmentNotifies the library that a fragment has paused.
Connect.onPauseFragment(
activity: Activity?,
logicalPageName: String?,
fragment: Any?
): BooleanParameters:
activity(required) — The host activity.logicalPageName(required) — The logical name of the fragment.fragment(required) — The fragment that paused.
Connect.onPauseNoActivityInForeground
Connect.onPauseNoActivityInForegroundNotifies the library that no activity is currently in the foreground.
Connect.onPauseNoActivityInForeground(): BooleanConnect.pauseTealeaf
Connect.pauseTealeafTemporarily pauses data capture.
Connect.pauseTealeaf(): BooleanConnect.resumeTealeaf
Connect.resumeTealeafResumes data capture after Connect.pauseTealeaf().
Connect.resumeTealeaf(): BooleanConnect.pauseTealeafIsUsingPause
Connect.pauseTealeafIsUsingPausePauses data capture and records that the library is in the paused state.
Connect.pauseTealeafIsUsingPause(usingPause: Boolean?): BooleanParameters:
usingPause(required) — Whether the library should record that it is in the paused state.
Connect.isUsingPause
Connect.isUsingPauseReturns true if the library is currently in the paused state.
Connect.isUsingPause(): BooleanConnect.resumeConnect
Connect.resumeConnectResumes data capture after a pause.
Connect.resumeConnect(
activity: Activity?,
logicalPageName: String
): Boolean
Connect.resumeConnect(
activity: Activity?,
logicalPageName: String,
postSession: Boolean
): BooleanParameters:
activity(required) — The activity that resumed.logicalPageName(required) — The logical name of the screen.postSession(optional) — Whether to post a session message on resume.
Screen views
Connect.getCurrentLogicalPageName
Connect.getCurrentLogicalPageNameReturns the logical name of the current screen.
Connect.getCurrentLogicalPageName(): StringConnect.setCurrentLogicalPageName
Connect.setCurrentLogicalPageNameSets the logical name of the current screen.
Connect.setCurrentLogicalPageName(name: String)Parameters:
name(required) — The logical name to assign to the current screen.
Connect.getCurrentScreenView
Connect.getCurrentScreenViewReturns the current Screenview object.
Connect.getCurrentScreenView(): Screenview?Gestures
Connect.dispatchTouchEvent
Connect.dispatchTouchEventDispatches a touch event to the library for gesture tracking. Call from your base activity's dispatchTouchEvent().
Connect.dispatchTouchEvent(
activity: Activity?,
motionEvent: MotionEvent?
): BooleanParameters:
activity(required) — The activity that received the touch event.motionEvent(required) — TheMotionEventto dispatch.
Connect.getDetector
Connect.getDetectorReturns the current gesture detector.
Connect.getDetector(): GestureDetectorConnect.setDetector
Connect.setDetectorSets the gesture detector.
Connect.setDetector(detector: GestureDetector?)Parameters:
detector(required) — TheGestureDetectorto use. Passnullto clear.
Messages
Connect.setAdditionalHeaders
Connect.setAdditionalHeadersSets additional HTTP headers to include on outgoing messages.
Connect.setAdditionalHeaders(headers: HashMap<String?, String?>?)Parameters:
headers(required) — Key-value pairs of additional headers. Passnullto clear.
Connect.getAdditionalHeaders
Connect.getAdditionalHeadersReturns the additional HTTP headers configured for outgoing messages.
Connect.getAdditionalHeaders(): HashMap<String, String>Connect.setAdditionalCookie
Connect.setAdditionalCookieSets an additional cookie to include on outgoing messages.
Connect.setAdditionalCookie(cookie: String?)Parameters:
cookie(required) — The cookie value to include. Passnullto clear.
Connect.getAdditionalCookie
Connect.getAdditionalCookieReturns the additional cookie configured for outgoing messages.
Connect.getAdditionalCookie(): StringConnect.getMessageVersion
Connect.getMessageVersionReturns the message version.
Connect.getMessageVersion(): StringCapture
Connect.isCaptureScreenContentsEnabled
Connect.isCaptureScreenContentsEnabledReturns true if screen-contents capture is enabled.
Connect.isCaptureScreenContentsEnabled(): BooleanConnect.updateCaptureScreenContentsEnabled
Connect.updateCaptureScreenContentsEnabledEnables or disables screen-contents capture.
Connect.updateCaptureScreenContentsEnabled(enabled: Boolean): BooleanParameters:
enabled(required) —trueto enable,falseto disable.
Connect.getDefaultLogLevel
Connect.getDefaultLogLevelReturns the default log level used by logging methods when no level is specified.
Connect.getDefaultLogLevel(): IntQueues
Connect.flushQueues
Connect.flushQueuesFlushes all pending data in the library's queues.
Connect.flushQueues(): BooleanConnect.displayUpdate
Connect.displayUpdateForces the library to post pending screen updates.
Connect.displayUpdate(): BooleanDiagnostics
Connect.getHttpXTealeafProperty
Connect.getHttpXTealeafPropertyReturns the value of the X-Tealeaf HTTP header property for the current session.
Connect.getHttpXTealeafProperty(): StringConnect.getEOCoreDeviceId
Connect.getEOCoreDeviceIdReturns the EOCore device ID.
Connect.getEOCoreDeviceId(): StringConnect.setEOCoreDeviceId
Connect.setEOCoreDeviceIdSets the EOCore device ID.
Connect.setEOCoreDeviceId(deviceId: String): BooleanParameters:
deviceId(required) — The device ID to assign.
Connect.getEOCoreCurrentSessionId
Connect.getEOCoreCurrentSessionIdReturns the EOCore current session ID.
Connect.getEOCoreCurrentSessionId(): String?Connect.getPixelDensity
Connect.getPixelDensityReturns the pixel density used when capturing screen layouts.
Connect.getPixelDensity(): FloatUpdated 8 days ago
