Stay organized with collections Save and categorize content based on your preferences.

Android Games

The android games library mirrors the Android Game SDK which is available as a binary download. You can use the androidx library instead of manually downloading and integrating the Android Game SDK into your build.

For more information about the Android Game SDK, see the SDK documentation and the SDK release notes.

This table lists all the artifacts in the androidx.games group.

Artifact Stable Release Release Candidate Beta Release Alpha Release
games-activity 1.2.2 - - -
games-controller 1.1.0 - - 1.1.1-alpha01
games-frame-pacing 1.9.1 - - 1.10.2-alpha01
games-memory-advice - - 1.0.0-beta03 -
games-text-input 1.1.1 - - 1.1.2-alpha01
games-performance-tuner 1.6.0 - - 1.6.1-alpha01
This library was last updated on: December 7, 2022

Requirements

games-memory-advice

The MemoryAdvice API requires your application to be built with one of the following NDK versions:

  • r20.*
  • r21.*
  • r23.*

Declaring dependencies

To add a dependency on game, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module; games-activity library has integrated the same version of the game-text-input library, hence GameActivity apps can not include the game-text-input dependency again:

Groovy

android {
    ...
    // To use the Android Frame Pacing or Android Performance Tuner libraries, enable
    // native dependencies to be imported. Libraries will be made available to your CMake build
    // as packages named "games-frame-pacing" and "games-performance-tuner".
    buildFeatures {
        prefab true
    }
}

dependencies {
    // To use the Android Frame Pacing library
    implementation "androidx.games:games-frame-pacing:1.9.1"

    // To use the Android Performance Tuner
    implementation "androidx.games:games-performance-tuner:1.6.0"

    // To use the Games Activity library
    implementation "androidx.games:games-activity:1.2.2"

    // To use the Games Controller Library
    implementation "androidx.games:games-controller:1.1.0"

    // To use the Games Text Input Library
    // Do not include this if games-activity has been included
    implementation "androidx.games:games-text-input:1.1.1"
}

Kotlin

android {
    ...
    // To use the Android Frame Pacing or Android Performance Tuner libraries, enable
    // native dependencies to be imported. Libraries will be made available to your CMake build
    // as packages named "games-frame-pacing" and "games-performance-tuner".
    buildFeatures {
        prefab = true
    }
}

dependencies {
    // To use the Android Frame Pacing library
    implementation("androidx.games:games-frame-pacing:1.9.1")

    // To use the Android Performance Tuner
    implementation("androidx.games:games-performance-tuner:1.6.0")

    // To use the Games Activity library
    implementation("androidx.games:games-activity:1.2.2")

    // To use the Games Controller Library
    implementation("androidx.games:games-controller:1.1.0")

    // To use the Games Text Input Library
    // Do not include this if games-activity has been included
    implementation("androidx.games:games-text-input:1.1.1")
}
}

For more information about dependencies, see Add build dependencies.

Add Gradle properties

You may need to add properties to the gradle.properties file located in the same directory as your app's (or module's) build.gradle file. If the gradle.properties file does not exist, then create this file.

If you are using Android Studio 4.0, make sure gradle.properties contains the following lines:

# Enables experimental Prefab
android.enablePrefab=true
# Tell Android Studio we are using AndroidX
android.useAndroidX=true

If you are using Android Studio 4.1 or later, make sure gradle.properties contains the following lines:

# Tell Android Studio we are using AndroidX
android.useAndroidX=true

Add packages with CMake

To make the imported Game SDK packages available, add the following to your main app's CMakeLists.txt file:

# Add the packages from the Android Game SDK
find_package(games-frame-pacing REQUIRED CONFIG)
find_package(games-performance-tuner REQUIRED CONFIG)

This will allow you to include header files from the Android Game SDK in your game code:

#include "swappy/swappyGL.h"
#include "tuningfork/tuningfork.h"

In your main app's CMakeLists.txt file, find target_link_libraries for the main shared library. Add the references to the Android Game SDK static libraries to include them in your shared library:

target_link_libraries(...
  games-frame-pacing::swappy_static
  games-performance-tuner::tuningfork_static
  ...)

Feedback

Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Games-Memory-Advice version 1.0.0

Version 1.0.0-beta03

November 9, 2022

androidx.games:games-memory-advice:1.0.0-beta03 is released. Version 1.0.0-beta03 contains these commits.

New Features

  • No new changes

Version 1.0.0-beta01

March 9, 2022

androidx.games:games-memory-advice:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.

  • No changes since 1.0.0-alpha01.

Version 1.0.0-alpha01

February 23, 2022

androidx.games:games-memory-advice:1.0.0-alpha01 is released. Version 1.0.0-alpha01 contains these commits.

New Features

  • This C library gives the facility to query and receive callbacks for changes in the memory state of a device which is running a game.

API Changes

  • This is the initial release of the memory advice library. See the header at include/memory_advice/memory_advice.h for the full API.

External Contribution

Games-Activity Version 1.2

Version 1.2.2

December 7, 2022

androidx.games:games-activity:1.2.2 is released. Version 1.2.2 contains these commits.

Bug Fixes

  • The maximum number of motion events can now be set at runtime.

Version 1.2.2-alpha01

November 9, 2022

androidx.games:games-activity:1.2.2-alpha01 is released. Version 1.2.2-alpha01 contains these commits.

API Changes

  • API now also contains version information in the form of GAMEACTIVITY_PACKED_VERSION. (I287e6)
  • Added onContentRectChanged callback which is called when the rectangle in the window where the content should be placed has changed. (I81396)

Bug Fixes

  • Fixed events buffer overflow. Both inputBuffer->keyEvents and motionEvents are now dynamically-allocated buffers. (Ic00f6)
  • Fails gracefully if out of memory. Added handling of realloc() errors during buffers resizing.

Version 1.2.1

July 13, 2022

androidx.games:games-activity:1.2.1 is released. Version 1.2.1 contains these commits.

Bug Fixes

  • Fixed issues with missing .aar file in previous release.

Version 1.2.0

June 15, 2022

androidx.games:games-activity:1.2.0 is released. Version 1.2.0 contains these commits.

Important changes since 1.1.0

  • Allow derived classes of GameActivity to handle native library loading.
  • Always load the native library in GameActivity.onCreate.
  • Fallback to loading library with name "main" if no other library found.

Games-Activity Version 1.1

Version 1.1.0

February 23, 2022

androidx.games:games-activity:1.1.0 and androidx.games:games-controller:1.1.0 are released. Version 1.1.0 contains these commits.

Important changes since 1.0.0

Games Activity:

  • WindowInsets listening and querying for notch and IME response
  • Add key and motion event filters
  • Bug fixes:
    • Add missing messages for compatibility with NativeActivity
    • Fix signature of onNativeWindowResized
    • Fix input event losses

Version 1.1.0-rc01

February 9, 2022

androidx.games:games-activity:1.1.0-rc01 and androidx.games:games-controller:1.1.0-rc01 are released. Version 1.1.0-rc01 contains these commits.

Version 1.1.0-beta03

January 26, 2022

androidx.games:games-activity:1.1.0-beta03 is released. Version 1.1.0-beta03 contains these commits.

Bug Fixes

  • Fix signature of onNativeWindowResized
  • Maintain handle to native window in onSurfaceChanged

Version 1.1.0-beta02

December 15, 2021

androidx.games:games-activity:1.1.0-beta02 is released. Version 1.1.0-beta02 contains these commits.

Bug Fixes

  • Fix race condition in event filter setting.

Version 1.1.0-beta01

November 17, 2021

androidx.games:games-activity:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.

New Features

  • Added support for querying window insets and listening for inset changes. This allows games to react to the IME popping-up and to deal with waterfall and camera cutout insets.

API Changes

  • void GameActivity_getWindowInsets(GameActivity* activity, enum GameCommonInsetsType type, GameCommonInsets* insets);

Bug Fixes

  • Avoid consuming all key events: volume, camera, etc. are now passed through to the system.

Version 1.1.0-alpha01

September 29, 2021

androidx.games:games-activity:1.1.0-alpha01 is released. Version 1.1.0-alpha01 contains these commits.

API Changes

  • onContentRectChanged callback added to GameActivityCallbacks

Bug Fixes

  • Missing messages added to android_native_app_glue.h:
    • APP_CMD_CONTENT_RECT_CHANGED
    • APP_CMD_WINDOW_REDRAW_NEEDED

Games Performance Tuner 1.6

Version 1.6.1-alpha01

November 9, 2022

androidx.games:games-performance-tuner:1.6.1-alpha01 is released. Version 1.6.1-alpha01 contains these commits.

New Features

  • No new changes

Version 1.6.0

June 15, 2022

androidx.games:games-performance-tuner:1.6.0 is released. Version 1.6.0 contains these commits.

Important changes since 1.5.0

  • Fixed getpid returning 0 while trying to get memory telemetry.
  • Stopped StopLoadingGroup from executing without an active loading group.

Games Performance Tuner 1.5.0

Version 1.5.0

February 9, 2022

androidx.games:games-performance-tuner:1.5.0 is released. Version 1.5.0 contains these commits.

Important changes since 1.4.0

  • Programmatically change the interval between uploads, rather than it being hard-coded in the initial settings.
    • Added function: TuningFork_setAggregationStrategyInterval
  • Fix for memory corruption in API key on API<=23

Version 1.5.0-rc01

January 26, 2022

androidx.games:games-performance-tuner:1.5.0-rc01 is released. Version 1.5.0-rc01 contains these commits.

Bug Fixes

  • Fix for memory corruption in API key on API<=23

Version 1.5.0-beta02

December 15, 2021

androidx.games:games-performance-tuner:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.

API Changes

  • Remove ABI-breaking change from TuningFork_Settings.

Version 1.5.0-beta01

September 29, 2021

androidx.games:games-performance-tuner:1.5.0-beta01 is released. Version 1.5.0-beta01 contains these commits.

New Features

  • No changes from alpha release. That release had:
    • Programmatically change the interval between uploads, rather than it being hard-coded in the initial settings.

API Changes

  • No changes from alpha release. That release had:
    • New function: TuningFork_setAggregationStrategyInterval
    • New field in TuningFork_Settings: aggregation_strategy_intervalms_or_count

Version 1.5.0-alpha01

August 18, 2021

androidx.games:games-performance-tuner:1.5.0-alpha01 is released. Version 1.5.0-alpha01 contains these commits.

New Features

  • It is now possible to set the interval between APT uploads programmatically, rather than using the settings file.

API Changes

  • Added function: TuningFork_setAggregationStrategyInterval
  • Added field to TuningFork_Settings struct: aggregation_strategy_intervalms_or_count

Games-Activity Version 1.0.0

Version 1.0.0

August 4, 2021

androidx.games:games-activity:1.0.0, androidx.games:games-controller:1.0.0, and androidx.games:games-text-input:1.0.0 are released. Version 1.0.0 contains these commits.

Major features of 1.0.0

This is the initial release to stable of Games-Activity, Games-Controller and Games-Text-Input. See the AGDK Home Page for more information.

Version 1.0.0-rc01

July 12, 2021

androidx.games:games-activity:1.0.0-rc01 is released. Version 1.0.0-rc01 contains these commits.

Bug Fixes

  • Fix return type of GameActivityCallbacks::onSaveInstanceState

Version 1.0.0-beta01

June 30, 2021

androidx.games:games-activity:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.

API Changes

  • Rename GameActivityInputInfo to GameActivityPointerAxes.
  • onNativeWindowResized callback now gives width and height of window.
  • onContentRectChanged callback has been removed.
  • onLowMemory was renamed to onTrimMemory.
  • GameActivity_setWindowFormat removed.
  • Improved ownership model for GameActivityMotionEvents and GameActivityMotionEvent pointers.
  • Improved ownership model of user state in onSaveInstanceState callback.

Version 1.0.0-alpha01

June 16, 2021

androidx.games:games-activity:1.0.0-alpha01 is released.

New Features

  • Games-Activity is a new library that replaces NativeActivity as the recommended way to integrate a C/C++ game with Android.

Games-Controller Version 1.1.0

Version 1.1.0

February 23, 2022

androidx.games:games-activity:1.1.0 and androidx.games:games-controller:1.1.0 are released. Version 1.1.0 contains these commits.

Important changes since 1.0.0

Games Activity:

  • WindowInsets listening and querying for notch and IME response
  • Add key and motion event filters
  • Bug fixes:
    • Add missing messages for compatibility with NativeActivity
    • Fix signature of onNativeWindowResized
    • Fix input event losses

Version 1.1.0-rc01

February 9, 2022

androidx.games:games-controller:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.

Version 1.1.0-beta01

January 26, 2022

androidx.games:games-controller:1.1.0-beta01 is released with no changes since 1.1.0-alpha01. Version 1.1.0-beta01 contains these commits.

Version 1.1.0-alpha01

December 15, 2021

androidx.games:games-controller:1.1.0-alpha01 is released. Version 1.1.0-alpha01 contains these commits.

New Features

Added support for battery status, dual-motor vibration, light control and motion axis reporting on supported controllers when running on Android S or higher.

API Changes

  • Added Paddleboat_setMotionDataCallback function for registering controller motion data callbacks
  • Added Paddleboat_setControllerLight function for changing controller light settings.
  • Added Paddleboat_Controller_Battery structure to Paddleboat_Controller_Data
  • New structures:
    • Paddleboat_Controller_Battery
    • Paddleboat_Motion_Data
  • New enums:
    • Paddleboat_BatteryStatus
    • Paddleboat_LightType
    • Paddleboat_Motion_Type
  • New controller flags:
    • PADDLEBOAT_CONTROLLER_FLAG_ACCELEROMETER
    • PADDLEBOAT_CONTROLLER_FLAG_GYROSCOPE
    • PADDLEBOAT_CONTROLLER_FLAG_LIGHT_PLAYER
    • PADDLEBOAT_CONTROLLER_FLAG_LIGHT_RGB
    • PADDLEBOAT_CONTROLLER_FLAG_BATTERY

Bug Fixes

  • Added alternate deviceId database entry for PS4 controller
  • Added API >=31 database entry for PS5 controller

Games-Controller Version 1.0.0

Version 1.0.0

August 4, 2021

androidx.games:games-activity:1.0.0, androidx.games:games-controller:1.0.0, and androidx.games:games-text-input:1.0.0 are released. Version 1.0.0 contains these commits.

Major features of 1.0.0

This is the initial release to stable of Games-Activity, Games-Controller and Games-Text-Input. See the AGDK Home Page for more information.

Version 1.0.0-rc02

July 21, 2021

androidx.games:games-controller:1.0.0-rc02 is released. Version 1.0.0-rc02 contains these commits.

Bug Fixes

  • Fixed packaging error that caused Prefab import to fail on empty, unused architecture/version permutations.

Version 1.0.0-rc01

July 12, 2021

androidx.games:games-controller:1.0.0-rc01 is released. Version 1.0.0-rc01 contains these commits.

Bug Fixes

  • Fixed an incompatibility issue with the latest GameActivity

Version 1.0.0-beta01

June 30, 2021

androidx.games:games-controller:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.

API Changes

  • Functions which returned a boolean for success or failure now return a Paddleboat_Error_Code enum.
  • Paddleboat_onPause renamed to Paddleboat_onStop
  • Paddleboat_onResume renamed to Paddleboat_onStart
  • Paddleboat_processGameActivityEvent split into two functions: Paddleboat_processGameActivityKeyInputEvent and Paddleboat_processGameActivityMotionInputEvent
  • Removed extended controller features that required building against a preview Android S SDK
  • Added Paddleboat_getBackButtonConsumed function
  • Controller and mouse status callbacks now have an optional parameter of a pointer to user defined data
  • Moved controller name string out of device info structure, now accessed via Paddleboat_getControllerName function

Bug Fixes

  • Fixed an issue where a controller that doesn’t initially report itself as a controller, but later on does via an onInputDeviceChanged message, wasn’t being properly detected as a controller connection.

Version 1.0.0-alpha01

June 16, 2021

androidx.games:games-controller:1.0.0-alpha01 is released.

New Features

  • Games-Controller is a new library that provides a C API for detecting, reading input from, and interacting with game controller devices.

Games-Text-Input Version 1.1

Version 1.1.2-alpha01

November 9, 2022

androidx.games:games-text-input:1.1.2-alpha01 is released. Version 1.1.2-alpha01 contains these commits.

New Features

  • No new changes

Version 1.1.1

July 13, 2022

androidx.games:games-text-input:1.1.1 is released. Version 1.1.1 contains these commits.

Bug Fixes

  • Fixed issues with missing .aar file in previous release.

Version 1.1.0

February 9, 2022

androidx.games:games-text-input:1.1.0 is released. Version 1.1.0 contains these commits.

Important changes since 1.0.0 - Added WindowInsets listening and querying functionality to GameTextInput - Add missing gamecommon.h header

Version 1.1.0-rc01

January 26, 2022

androidx.games:games-text-input:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.

Version 1.1.0-beta01

December 15, 2021

androidx.games:games-text-input:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.

Bug Fixes

  • Fix waterfall and IME insets
  • Add missing gamecommon.h header

Version 1.1.0-alpha01

October 13, 2021

androidx.games:games-text-input:1.1.0-alpha01 is released. Version 1.1.0-alpha01 contains these commits.

API Changes

  • Added IME insets functionality to GameTextInput

Games-Text-Input Version 1.0

Version 1.0.0

August 4, 2021

androidx.games:games-activity:1.0.0, androidx.games:games-controller:1.0.0, and androidx.games:games-text-input:1.0.0 are released. Version 1.0.0 contains these commits.

Major features of 1.0.0

This is the initial release to stable of Games-Activity, Games-Controller and Games-Text-Input. See the AGDK Home Page for more information.

Version 1.0.0-rc01

July 12, 2021

androidx.games:games-text-input:1.0.0-rc01 is released with no changes. Version 1.0.0-rc01 contains these commits.

Version 1.0.0-beta01

June 30, 2021

androidx.games:games-text-input:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.

API Changes

  • Improved ownership model of GameTextInputState objects.
  • Tidying of types to be consistent with NDK.

Version 1.0.0-alpha01

June 16, 2021

androidx.games:games-text-input:1.0.0-alpha01 is released.

New Features

  • Games-Text-Input is a new library to help game developers use Android soft keyboard input from C/C++.

Games Frame Pacing 1.10

Version 1.10.2-alpha01

November 9, 2022

androidx.games:games-frame-pacing:1.10.2-alpha01 is released. Version 1.10.2-alpha01 contains these commits.

New Features

  • No new changes

Version 1.10.1

June 15, 2022

androidx.games:games-frame-pacing:1.10.1 is released. Version 1.10.1 contains these commits.

Bug Fixes

  • Fix for swappy not building with ndk <23 and >17.
  • Exposed API to retrieve the refresh rates supported by the display.

Version 1.10.0

February 23, 2022

androidx.games:games-frame-pacing:1.10.0 is released. Version 1.10.0 contains these commits.

Important changes since 1.9.0

  • Ignore polluting choreographer filter inputs and smooth more to prevent freezes on emulator
  • Add *_uninjectTracer functions.

Version 1.10.0-rc01

February 9, 2022

androidx.games:games-frame-pacing:1.10.0-rc01 is released. Version 1.10.0-rc01 contains these commits.

Version 1.10.0-beta01

January 26, 2022

androidx.games:games-frame-pacing:1.10.0-beta01 is released. Version 1.10.0-beta01 contains these commits.

Version 1.10.0-alpha01

December 15, 2021

androidx.games:games-frame-pacing:1.10.0-alpha01 is released. Version 1.10.0-alpha01 contains these commits.

New Features

  • Addition of SwappyGL_uninjectTracer function.

API Changes

  • Remove callbacks that were previously added using SwappyGL_injectTracer by using SwappyGL_uninjectTracer(const SwappyTracer *t) API.

Games Frame Pacing 1.9

Version 1.9.1

October 13, 2021

androidx.games:games-frame-pacing:1.9.1 is released. Version 1.9.1 contains these commits.

Bug Fixes

Version 1.9.0

July 12, 2021

androidx.games:games-frame-pacing:1.9.0 is released. Version 1.9.0 contains these commits.

Important changes since 1.7.0

  • Updated to match internal versioning scheme.

Games Frame Pacing 1.7.0

Version 1.7.0

June 30, 2021

androidx.games:games-frame-pacing:1.7.0 is released. Version 1.7.0 contains these commits.

Version 1.7.0-rc01

June 2, 2021

androidx.games:games-frame-pacing:1.7.0-rc01 is released. Version 1.7.0-rc01 contains these commits.

Version 1.7.0-beta02

February 24, 2021

androidx.games:games-frame-pacing:1.7.0-beta02 is released.

Version 1.7.0-beta01

December 16, 2020

androidx.games:games-frame-pacing:1.7.0-beta01 is released.

Games Performance Tuner 1.4.3

Version 1.4.3

July 12, 2021

androidx.games:games-performance-tuner:1.4.3 is released. Version 1.4.3 contains these commits.

Important changes since 1.1.0

  • Updated to match internal versioning scheme.

Games Performance Tuner 1.1.0

Version 1.1.0

June 30, 2021

androidx.games:games-performance-tuner:1.1.0 is released. Version 1.1.0 contains these commits.

Version 1.1.0-rc01

June 2, 2021

androidx.games:games-performance-tuner:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.

Version 1.1.0-beta03

April 21, 2021

androidx.games:games-performance-tuner:1.1.0-beta03 is released.

Version 1.1.0-beta02

February 24, 2021

androidx.games:games-performance-tuner:1.1.0-beta02 is released.

Version 1.1.0-beta01

December 16, 2020

androidx.games:games-performance-tuner:1.1.0-beta01 is released.

Version 1.1.0-alpha01

androidx.games:games-performance-tuner:1.1.0-alpha01 is released.

Version 1.0.0

Version 1.0.0-alpha02

August 12, 2020

The Android Gaming library was renamed to the Android Games library.

androidx.gaming -> androidx.games

Version 1.0.0-alpha01

June 10, 2020

androidx.games:1.0.0-alpha01 is released.