Skip to content
  • There are no suggestions because the search field is empty.

How to implement the match clock for eTouchdown using Java SDK?

To implement a real-time match clock for eTouchdown using the Java SDK, you will need to extract the time attributes from the Scoreboard object and synchronise them with a local frontend timer.1. Parse the scoreboard data from the SDK When you receive an OddsChange message in your OddsFeedListener, extract the Match object and access its MatchStatus. From there, you can retrieve the Scoreboard object and its time attributes using the getRemainingGameTime() and getElapsedTime() methods.

Match match = (Match) oddsChange.getEvent();
MatchStatus status = match.getStatus();

// Check if the scoreboard is currently available
if (status != null && status.isScoreboardAvailable()) {
    Scoreboard scoreboard = status.getScoreboard();

    if (scoreboard != null) {
        // Extract the time data
        Integer remainingGameTime = scoreboard.getRemainingGameTime(); // Seconds left in the current period
        Integer elapsedTime = scoreboard.getElapsedTime(); // Total seconds passed since match start

        // Pass these parsed values to your frontend UI
    }
}

2. Run a local timer on the frontendBecause the Odds Feed is event-driven and does not send updates every single second, you should start a local ticking clock on your frontend UI. This local timer should continuously count down the remainingGameTime and count up the elapsedTime between feed updates.
3. Synchronise the clockWhenever a new OddsChange message arrives containing fresh scoreboard data, overwrite your frontend's local clock values with the new data parsed from the SDK. This synchronisation acts as an anchor, correcting any drift on the local timer and ensuring your UI stays aligned with the official match time.