头图

Author / Android DevRel Technical Lead Manager Wayne Lu

We released Android Game Development Kit (AGDK) , and collected some popular questions raised by developers, including AGDK libraries and tools, Android memory optimization, and drawing graphics.

AGDK and game engine

First of all, early emerging game developers asked us how to use this set of AGDK libraries and tools. We give the following suggestions, depending on your settings:

  1. If you are using Defold , Godot , Unity or Unreal and other popular game engine , you can according to our guide, learn how to develop applications on Android. Using these game engines can help you focus on building gameplay rather than the entire technology stack.
  2. If you use the Unreal engine and target multiple platforms (such as PC or host), Android Game Development Tool Extension (AGDE) may be a good supplement to your workflow.
  3. We also provide support for developers who want to customize and write their own game engine. You can learn more in C or C++ document

After choosing a game engine and workflow, you can further study our tools, such as Android Studio Performance Profiler Android GPU Inspector that can analyze graphics, Android Performance that can optimize frame rate and loading time Tuner .

Game Mode API and Intervention

After that, we received questions about developing for Android 12. You don't need to perform any special operations to run the game on Android 12. We introduced game mode API and intervention to help players customize their game experience.

  1. You can read more about the game mode API and learn how to optimize the game when the user selects the corresponding game mode for the best performance or the longest battery life.
  2. You can learn more about game mode intervention , these interventions are set by original equipment manufacturers (OEM) to improve the performance of games that are no longer updated by developers. For example: adjust the size of the WindowManager back buffer to reduce the GPU load of the device.

Android memory access

Secondly, some developers asked about the similarities and differences in the working principles of memory access when developing games in Android and Windows. In short, the main points are as follows:

  1. The game needs to share memory with the system. Some devices have less available memory than others, so testing is needed to check for out-of-memory issues with a range of supported devices. The test should be carried out on a device where the user has installed a typical application (ie, a non-new device).
  2. The amount of memory that the game can allocate for depends on various factors, such as the amount of physical memory, the number of dirty pages, and the total amount of zRam (used for compressed swap).
  3. Insufficient memory may manifest as onTrimMemory() call, memory jitter, or Low Memory Killer terminate the game. You can use bugreport log inspection low memory termination daemon (Low Memory Killer) whether the game has been terminated, or check in Android 11 and later versions ApplicationExitInfo , to see whether the game because REASON_LOW_MEMORY terminated.
  4. Avoid memory jitter : This happens when the memory is low but not enough to terminate the game. You can detect this by tracking system, and you should avoid this problem by reducing the overall memory usage.
  5. Use Android performance profiler and other tools check memory usage.

Drawing graphics in Android

Third, we received a question about how to draw graphics in Android. You can achieve this with the help of the following options: OpenGL ES or Vulkan Graphics API :

  1. Learn how to configure OpenGL ES graphics by initializing variables and using game loops, scenes and objects for rendering.
  2. Read our Vulkan guide to learn how to draw cubes, compile shaders, set verification layers, and other best practices.

You can watch the Q&A video view popular questions about AGDK, or visit the Android official website get the latest resources on Android game development.

Welcome to click here to submit feedback to us, or share your favorite content, problems found. Your feedback is very important to us, thank you for your support!


Android开发者
404 声望2k 粉丝

Android 最新开发技术更新,包括 Kotlin、Android Studio、Jetpack 和 Android 最新系统技术特性分享。更多内容,请关注 官方 Android 开发者文档。