On top of the stats API exposed by the SDK, we created a view helper to help you integrate and understand CDN Orchestrator faster. The DebugView will inform you about the different states of the SDK lifecycle and Streamroot metrics.
The view looks like the following:
debugView is really simple.
First, you will need to add the following Streamroot dependency to the
build.gradle file of your app module.
Then, you will need to update your layout to include the following snippet
<io.streamroot.ctl.delivery.client.utils.CTLStatsView android:id="@+id/dcStatsView" android:layout_width="match_parent" android:layout_height="match_parent" />
Back to the Kotlin side, find the corresponding view and attach it to a local declaration.
private lateinit var dcStatsView: CTLStatsView
onCreate(savedInstanceState: Bundle?) method, find the stats view in the associated layout.
dcStatsView = findViewById(R.id.dcStatsView)
Once the view has been setup, it will should be registered to the delivery client as a State Listener. Meaning, It will basically be notified of the current state of the SDK and will be updated at each new statistics, which make it easier for the developer to monitor. We can call then
showStats to make the data visible in the stats view.