目录

The GameSummaryClient class defines the APIs for obtaining game information.

Public Method Summary

Return

Method

Task<GameSummary>

getLocalGameSummary()

Obtains the information about the current game from the local cache.

Task<GameSummary>

getGameSummary()

Obtains the information about the current game from Huawei game server. If the obtaining fails, the locally cached information is obtained.

Public Methods

public Task<GameSummary> getLocalGameSummary()

Obtains the information about the current game from the local cache asynchronously.

Return Values

Type

Description

Task<GameSummary>

GameSummary object that contains the information about the current game.

You need to set two callback listeners in the Task returned by the API. OnSuccessListener obtains the data returned in the success scenario, and OnFailureListener obtains the information about the request failure. In OnFailureListener, you need to check whether the exception object called back in this mode is an ApiException instance object, and resolve the failure according to getStatusCode() contained in the ApiException instance.

public Task<GameSummary> getGameSummary()

Obtains the information about the current game from Huawei game server asynchronously. If the obtaining fails, the locally cached information is obtained.

Return Values

Type

Description

Task<GameSummary>

The information about the current game.

You need to set two callback listeners in the Task returned by the API. OnSuccessListener obtains the data returned in the success scenario, and OnFailureListener obtains the information about the request failure. In OnFailureListener, you need to check whether the exception object called back in this mode is an ApiException instance object, and resolve the failure according to getStatusCode() contained in the ApiException instance.