implementation("io.github.thoughtspot:android-embed-sdk:1.0.0")
Andriod Embed SDK for Andriod apps
Your application developers can embed a ThoughtSpot Liveboard in your native Android app using the ThoughtSpot Android Embed SDK.
Before you beginπ
Before you begin, ensure that your development environment has the following setup:
-
Access to a ThoughtSpot instance with administrator and developer privileges.
-
Access to the Liveboard object that you want to embed.
-
Android Studio is installed.
Install the SDKπ
To download the Android Embed SDK from Maven Central to your project and install the libraries, add the following code to your app-level build.gradle.kts:
-
implementation
Instructs Gradle to add the dependency for compile and runtime usage in your Android project. -
com.github.thoughtspot
GitHub reference ID -
android-embed-sdk
The GitHub repository of the Android Embed SDK package. -
Tag
Indicates the version of the SDK to use. Replace this with a specific release tag from the GitHub repository. For example,1.0.0.
The SDK may require network access to communicate with your ThoughtSpot instance. Ensure your appβs AndroidManifest.xml includes the following:
XML Layoutπ
In the activity_main.xml of your project, add the following elements to create a custom Android view component for Liveboard embedding:
<!-- res/layout/activity_main.xml -->
<com.thoughtspot.android.embedsdk.LiveboardEmbed
android:id="@+id/liveboard_embed_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/another_view"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
-
<com.thoughtspot.android.embedsdk.LiveboardEmbed β¦β />
Declares a custom view to render the Liveboard in the app. -
android:id="@+id/liveboard_embed_view"
Assigns a unique ID to this view so you can reference it in your Kotlin/Java code. -
android:layout_width="match_parent"andandroid:layout_height="wrap_content"
These elements set the width and height of the layout for the embed view. -
The
app:layout_constraintβ¦βattributes
Positions the view relative to the other UI elements.
In the next step, weβll add a reference to this view and then load a specific Liveboard into it.