[ Web Proxy ]
URL:
Viewing: https://developer.android.com/games/agdk/game-activity [Back]  [Original]

GameActivity  |  Android game development  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Send feedback Stay organized with collections Save and categorize content based on your preferences.

GameActivity Part of Android Game Development Kit.

GameActivity is a Jetpack library designed to assist Android games in processing app cycle commands, input events, and text input in the application's C/C++ code. GameActivity is a direct descendant of NativeActivity and shares a similar architecture:

alt_text [alt_text]

As illustrated in the above diagram, GameActivity performs the following functions:

With GameActivity, you can focus on your core game development and avoid spending excessive time dealing with the JNI code.

If you are already familiar with NativeActivity, the major differences between GameActivity and NativeActivity are as follows:

Note: We strongly recommend using GameActivity for new games and other C/C++ intensive applications. If you have an existing NativeActivity application, we recommend migrating to GameActivity.

Release locations

The GameActivity library is available in the following channels:

The C/C++ code is provided as source code in all release channels, using the Prefab format. GameActivity version 1.2.2 adds a static library to the distribution. Starting with this version and later, we recommend you use the static library instead of the source code.

Note: Most of the documentation on this site is written from the perspective of AndroidX.

Contents of Jetpack library

With the Jetpack library, GameActivity is released with an AAR. This AAR contains the following major components:

The integration instructions linked to from this page assume that you can use Prefab in your build system; otherwise, you can copy the source code packed under the prefab/modules/game-activity/include folder into your build system and perform the necessary integration steps. A similar file structure exists for the releases under androidx for the Android Jetpack library; by default, gradle unpacks AARs in its cache directory (~/.gradle/caches/...). You can find the C/C++ source code by searching for prefab/modules/game-activity/include and picking up the location under your intended release version.

For instructions on integrating using the Jetpack library, see Get started with GameActivity.

Content of AOSP source code

AOSP always contains the most recent source code. Follow [the build instructions][GameActivity implementation]{: .external} to create your own releases or directly integrate the source into your build environment. The C/C++ source code is saved in a file structure similar to the Jetpack library.

Integration guides

Follow those guides to integrate GameActivity into your applications:

Additional resources

To learn more about GameActivity, see the following:

Feedback

To report bugs or request new features to GameActivity, use the GameActivity issue tracker.

Send feedback

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-02-26 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-02-26 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page