[MUSIC PLAYING]
VICTOR REPETSKYI: Hello.
I'm Victor Repetskyi, the Technical Lead for Android
Games Team in London.
ARTYOM PALVELEV: And I'm Artyom Palvelev, Software Engineer
for Android Games Team.
VICTOR REPETSKYI: In this talk, I will be covering new C/C++
Libraries designed to help you build games and game engines.
ARTYOM PALVELEV: And I'll be covering GameActivity Library.
VICTOR REPETSKYI: To recap, AGDK includes integrated workflow
tools like updated Visual Studio extension,
a suite of of C and C/C++ Development Libraries,
and lastly, they have focused on performance optimization
to improve your game performance,
both pre and post launch.
Android Performance Tuner is a telemetry offer
and it is part of AGDK and Android Vitals.
It helps you measure the quality of your user experience
by showing you frame time, loading time and abandonment
rates.
Diagnose and prioritize your game performance issues
by helping you understand when in the game
problems are happening and in what situations.
Lastly, it helps you get the best out of every device
by helping you better map quality levels to devices.
In the past year, we've seen some great examples
of developers using APT to better understand
what their field performance looks like and adjust
the availability of their game.
Stay tuned for more updates coming.
The updated are our Game Libraries.
Firstly, game activity, which provides a foundation for C++
game to be built on.
Game text input, which is a stable way to use software
convert in C, and game controller.
This is a way to handle input from game controllers in C
to map their functions and to reconnect to devices when
necessary.
This is on top of our frame pacing API,
which improves frame stability and touch latency.
And of course, our high performance audio library,
which reduces audio latency and provides an easier
way to use the most efficient audio API for a given device.
How our libraries are distributed.
You can get them as ARR packages from Jetpack.
You can get both static and dynamic binaries
of the libraries from the AGDK files.
And for advanced integration, you
can get the source code from the Android open source project.
Games generate frames at different pace
to display capability of showing them.
Frame pacing allows optimal use of CPU and GPU,
decreases latency and provides consistency
of frame statistics.
Now, it supports Vulkan frame statistics.
It is complicated to write a full screen Android app
in C/C++ that uses the software keyboard for text input.
The typical workarounds involves issuing and hiding
edit text box.
However, this requires you to handle many edge cases
to ensure that this works across different devices, input
methods, editors and platform changes.
Game Text Input provides a simple API
to show and hide the software keyboard,
set and get the current edit in text,
and receive notifications when the text is changed.
Features supported are text input, text selection,
composing region, spell-checking, completions
and multi-key characters.
Implementing Game Controller support in C and C++ Android
applications has always involved a fair bit of work from
developers.
Events from controller devices can be accessed in native codes
through the input functionality of AGDK,
but enumeration of relevant input devices or capabilities
of those input devices and receiving
notifications of device connections and removal
are not available through current API.
Application must implement this functionality via our JNI code
that uses the input manage API.
Game Controller API has the complexity and allows you
to handle controller event in your C/C++ code.
Features supported are callbacks for detecting
controller connections and disconnections, controller
device information, including button style and layout,
controller input data, standardized
around modern [INAUDIBLE] controller designs.
Extended features on support and controllers
include vibration, lights, motion, access data,
and battery status, reading input
from virtual and physical mouse devices, ability
to specify custom controller mapping
data for particular devices.
What is new in Game Controller API?
Hardware keyboard detection, integrated sensor motion data,
reporting support and new optimized controller
mapping data format.
Oboe is a C++ library, which makes it easy to build high
performance audio apps on Android.
It was created primarily to allow developers
to target simplified API that works across multiple API
levels.
What is new in Oboe?
Channel mask support is supported for AAudio in API 32
and above, added methods for setting delay
before close to audio streams, and added audio extensions
allowing you to query for, enable and disable
and MMAP support.
ARTYOM PALVELEV: GameActivity is a component of Android Game
Development Kit.
Let us explain how GameActivity makes developers' lives easier.
Activity class is a standard Android interface
and the starting point of any Android app.
It provides access to the rendering surface
and helps you handle lifecycle and input events.
However, high performance game engines are often made in C++
and developers need a way to handle all aspects of Activity
class.
Native code developers can use JNI
to communicate with Activity, but this way
is complicated and error prone.
GameActivity is designed to simplify
interop between Activity and the native code.
GameActivity is a class that is designed for games
but can be used by any native code applications.
It provides convenient access to Android APIs.
Also, it provides access to a richer set
of Android UI components like Android X Fragment Component.
It helps Application Control render and servers,
observe configuration changes and interact with the system.
There are several ways of interaction between the game
and the system.
Using GameActivity.h callbacks and APIs,
using native glue callbacks in a separate thread.
A more flexible approach, using additional libraries
or using JNI to implement your own native code interfaces.
A simple way of integrating game activity
is just providing your callbacks and doing your processing
in the same thread.
A problem with this approach is some operations
might take unexpectedly long time.
In this case, the main activity thread will be blocked
and ANR may occur, which means the application will
be killed by the OS.
To help you avoid this, we provide
an additional level of abstraction
called Android native app glue.
It works with additional user-created thread
which it sends asynchronous messages through.
We saw this technique significantly reducing ANR rate
in games.
Check out AGDK samples to learn more
about app glue integration.
[INAUDIBLE] games team has identified
that ANRs can be caused by large amount of touch input
blocking the main activity thread.
They realized that they can take advantage of game activities
asynchronous event handling with separate thread
and double buffering.
After GameActivity was integrated,
they observed 35% ANR rate reduction.
I'd like to stress the fact that we highly
recommend using GameActivity instead of NativeActivity.
It's more powerful and flexible.
It provides the application more stability.
Check out the documentation in the description
to find out more or check out AGDK samples on how it's done.
Thanks.