jMonkeyEngine / jMonkeyEngine/jmonkeyengine

[Android] Add support for the new Game-Mode API

Open
#1,995 3 comments 4 reactions 1 assignee View on GitHub

@jaime-jmebot is already working on this.

Since Sep 17, 2026.

Android
Dominant language
Java
Stars
4.3k
Forks
1.2k
Avg merge
4d 7h
Merged PRs (30d)
14

Description

The Android team has launched a new API that's shipped with Android-12, the Game-Mode API reads the system game mode configuration to optimize the game accordingly using jMonkeyEngine APIs or submitting a call to the Android Stock Game interventions APIs, the first approach to this should be integrating a call to the Game-Mode API and adding a listener for that to be handled independently through users actions, for example, altering Lod, loading low-poly models or playing with frame-rates and disabling game filters.

A dummy example:

public interface GameMode {
      void onDisabled(GameManager gameManager);
      void onPerformanceEnabled(GameManager gameManager);
      void onBatterySaverEnabled(GameManager gameManager);
      void onStandardEnabled(GameManager gameManager);
}

...

// Later on JmeSurfaceView
GameMode gameMode;
...
// Only call this for Android 12 and higher devices
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ) {
  // Get GameManager from SystemService
  GameManager gameManager = Context.getSystemService(GameManager.class);

  // Returns the selected GameMode
  int gameMode = gameManager.getGameMode();
  if (gameMode == UNSUPPORTED) {
      gameMode.onDisabled(gameManager);
  } else if (gameMode == STANDARD) {
      gameMode.onStandardEnabled(gameManager);
  } else if (gameMode == BATTERY) {
      gameMode.onBatterySaverEnabled(gameManager);
  } else if (gameMode == PERFORMANCE) {
      gameMode.onPerformanceEnabled(gameManager);
  }
} else {
      gameMode.onDisabled(gameManager);
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.