Integrating with Android projects
Steps
1. Download the GameBench SDK
This is a .zip file available from the GameBench downloads site. Unzip it and extract the file lib/GameBench.aar
. This is the native library you must add to your Android Studio project.
2. Add GameBench.aar
to your Android Studio project
Open the build.gradle
file of your application module and add GameBench.aar
to the dependencies block:
dependencies {
...
+ implementation(files:'/path/to/GameBench.aar')
}
3. Write some code
The GameBench SDK must be configured at runtime, as early as possible. Here is a simple example :
4. Build and deploy to a device
The automatic session will start recording when your app is launched. Let the app run for at least 10 seconds, as any sessions shorter than that are considered invalid and will be discarded. Send the app to the background without killing the process - i.e. use the home button or switch to a different app. The session will be uploaded while the app is backgrounded.
In your web browser open the GameBench server you specified as your upload URL, and ensure you are logged in with the same credentials. Switch to the “Sessions” tab and your session should be visible.
5. Troubleshooting
The GameBench SDK has no user interface by design and cannot display helpful messages when something goes wrong. If your session didn’t appear on the server the immediate things to check are:
- Credentials are correct
- Test device is connected to the internet
- Test device can reach the GameBench server
- Session was at least 10 seconds long
- App gets enough time in the background to upload
If these conditions are all met then the next step is to check logcat. The SDK logs errors and warnings there using the tag GBSDK, filtering logcat for that should turn up useful information.