On top of the stats API exposed by the SDK, we created a view helper to help you integrate and understand CDN Mesh Delivery faster. The StatsView will inform you about the different states of the SDK lifecycle and Streamroot metrics.
The view looks like the following:
Adding a StatsView 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.dna.utils.stats.StatsView android:id="@+id/streamroot_stats" android:layout_width="match_parent" android:layout_height="wrap_content" />
Finally, initialize a StreamStatsManager and give it the instance of the SDK you previously instantiated:
streamrootDnaStatsView = findViewById(R.id.streamrootDnaStatsView); streamStatsManager = StreamStatsManager.newStatsManager(<StreamrootSDK>, streamrootDnaStatsView);
When you close the Streamroot SDK, close the StatsManager as well.
streamStatsManager.close(); streamStatsManager = null;
Knowing how many Mesh sources are connected to you and how much offload a single SDK instance is performing while you are integrating the SDK could be useful. It could also be used to send data to third parties analytics.
Please refer to our Client API documentation to learn how to use it.