Debugging
The SDK is designed to be as silent as possible and use very few resources. You will not get much information by default in your development console.
There are 2 debug log types that can be enabled or disabled at any time:
- info log
- verbose log
Info Log
Short messages are output explaining when the SDK performs an action.
Enable info log when implementing the SDK — remember to turn it off in production!
GameAnalytics.setEnabledInfoLog(true);
Example output:
Info/GameAnalytics: Add DESIGN event: {eventId:someEvent, value:0}
Info/GameAnalytics: Add DESIGN event: {eventId:someOtherEvent, value:100}
Info/GameAnalytics: Add ERROR event: {severity:info, message:This is some in}
Enable the info log to verify that events are being sent without issues. Events should appear in the realtime dashboard in the GameAnalytics tool after a short delay.
Read more about the Realtime Dashboard here.
Verbose Log
Console output when each event is added — all fields in JSON string format. Enable this when troubleshooting specific events:
// enable verbose log
GameAnalytics.setEnabledVerboseLog(true);
// add event you need to troubleshoot / inspect
GameAnalytics.addDesignEventWithEventId("Some:Event", 100);
// disable verbose log
GameAnalytics.setEnabledVerboseLog(false);
Event Queue
Whenever an event is added and validated, it is stored in a local database queue.
Every 8 seconds the SDK submits queued events in a separate low-priority thread, minimising performance impact. The payload is gzipped to reduce bandwidth usage.
When a device is offline, events remain in the queue and are submitted once the device is back online.
Thread Handling
Almost all SDK code runs on a dedicated low-priority serial thread queue to avoid UI lag or sudden performance spikes. Each task executes sequentially. For example:
// Configure build version
GameAnalytics.configureBuild("alpha 0.1.0");
// Initialize
GameAnalytics.initializeWithGameKey("12341234123412341234123412341234", "1234123412341234123412341234123412341234");
// Add Design event
GameAnalytics.addDesignEventWithEventId("Some:Event");
The configureBuild call completes before initialize, and the design event is submitted only after initialization is complete. The queue ensures every task finishes in order.