This is a basic sample app that demonstrates the use of Adaptability features such as Thermal API, Performance Hint API, Game Mode API and Game State API.
Before building in Android Studio, the following prerequisites must be met:
Minimum API level of 33 (Android 13) and supported devices (such as Pixel 6~) are required for the Game Mode API to be working
This sample utilizes 3rd party libraries such as IMGui and BulletPhysics. Here are the steps to setup the required libraries:
- Open a terminal and set the working directory to
./third_party/
- Run:
git clone -b v1.80 https://github.com/ocornut/imgui
- Run:
git clone https://github.com/bulletphysics/bullet3
Once the prerequisites are complete, open the folder in Android Studio 4.2 or higher. You can then build and run the sample from Android Studio
To switch between the game modes, you can use the Game Dashboard (Available on Pixel devices) or similar applications provided by OEM (such as Game Space or Game Booster).
If you are using Game Dashboard and the icon is not showing upon launching the game, you may need to upload your application to Google Play Console and install it via Play Store (you can start an internal test track and allowlist your own account to access it)
During development, if you are using device without Game Dashboard and the manufacturer do not provide any way to set Game Mode for each application, you can change the Game Mode status via adb
adb shell cmd game mode [standard|performance|battery] <PACKAGE_NAME>
https://developer.android.com/games/gamemode/gamemode-api
https://developer.android.com/reference/android/app/GameManager
Copyright 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.