Java API Reference

The GameBench Java API is intended for native Android apps. The API is a set of static methods on the GameBench class which is in the com.gamebench.sdk package which is in libgamebench.aar.

Sessions

static boolean startSession(String title)
Starts a new capture session, with an optional title.

static boolean stopSession()
Stops the current capture session.

static String getSessionId()
Returns the UUID of the active session, or null if there isn’t one.

static void upload(UploadCallback callback)
Uploads any outstanding sessions to the endpoint configured in the UI. After successful upload the session data will be removed from the device. Must be called without an active session.

NB: The callback is a nullable pointer to the UploadCallback interface which contains the single method void uploadComplete(int numSessionsUploaded, String error);

Screenshots

TODO.

Markers

To isolate specific areas of gameplay such as levels or battles, GameBench provides markers functionality. For example, to isolate performance data during a particular game level, you can call recordStartMarker() when the level begins and recordStopMarker() when the level is completed.

static void markerStart(String name, String group)
Record a ‘start’ marker with the given name and marker group (optional).

static void markerStop(String name, String group)
Record a ‘stop’ marker with the given name.

static void markLaunchComplete()
Record a ’launch complete’ marker that has a special significance in the web dashboard.

Tags

static void setTag(String name, String value)
Set a tag in the tags collection. Passing a null value will remove it.

Configuration

static void setConfigItem(String name, String value)
static void setConfigItem(String name, int value)
static void setConfigItem(String name, boolean value)

See the Configuration section for the full list of configurable items.

Note that these values set in code are transient and do not persist beyond process exit.

Last updated on