SDK Structure

Understand the organization of the OpenWeb Android SDK.

The OpenWeb Android SDK is designed to provide a modular and flexible architecture, enabling publishers to easily integrate and customize features for their applications.

This page provides an overview of the SDK’s structure and its key components.


Data Flow and Interaction

The OpenWeb SDK operates as a highly modular system with the following key interactions:

  1. Initialization: OWManager initializes the SDK and sets the spotId.
  2. UI Management: OWUI provides customizable pre-built screens.
  3. Authentication: OWAuthentication provides authentication capabilities.
  4. Analytics Tracking: OWAnalytics provides event tracking and optional delegation to the publisher.
  5. Utilities: OWHelpers handles configuration, logging, and other supporting features.


Core Components

OWManager

OpenWeb.manager serves as the entry point and core configuration manager for the SDK. It orchestrates various subsystems and manages the SDK’s initialization via spotId.

Example:

OpenWeb.manager.spotId = "YOUR_SPOT_ID"

OWUI

OWUI provides pre-built UI components and flows for seamless integration with your app. It includes:

  • Authentication Management: Allows publishers to define their own login flow via OWUIAuthentication.
  • Customization Options: Includes tools for altering themes, sorting options, and button styles.
  • Flows and Views: Pre-built screens for conversations, threads, and comment creation.

OWAnalytics

OWAnalytics is the analytics subsystem for tracking user interactions and events. It allows publishers to:

  • Monitor custom BI events using analyticAdditionalInfo.
  • Set up an AnalyticsEventDelegate to intercept and handle analytics events.

Example:

OpenWeb.manager.analytics.setAnalyticsEventDelegate(myDelegate)

OWHelpers

OWHelpers provides utilities to support additional configurations and debugging tools.

Key Features:

  • Logging Configuration: Customize log levels and outputs.
  • Language and Locale Management: Adjust language preferences and locale settings.
  • Orientation Enforcement: Manage screen orientation policies.

Example:

OpenWeb.manager.helpers.loggerConfiguration.level = OWLogLevel.DEBUG

OWAuthentication

OWAuthentication handles user authentication and Single Sign-On (SSO) flows. This includes:

  • Renewing SSO tokens.
  • Checking user login status.
  • Triggering logout functionality.

Example:

OpenWeb.manager.authentication.startSSO(callback = object : SpotCallback<StartSSOResponse> {
    override fun onSuccess(response: StartSSOResponse) {
        // Handle success
    }

    override fun onFailure(exception: SpotException) {
        // Handle failure
    }
})

Next Steps

Now that you understand the structure of the SDK, you can proceed to:

Explore the API Reference for detailed information on each class and method.