Merge "Get systraces from devicefarm tests"
tree: dbf4ab3f14cc0a24dceb08a1bade521e7e7df0f5
  1. bender/
  2. gradle/
  3. hooks/
  4. include/
  5. samples/
  6. src/
  7. test/
  8. third_party/
  9. .gitignore
  10. ab_info.py
  11. build.gradle
  12. build.sh
  13. gradle.properties
  14. gradlew
  15. gradlew.bat
  16. LICENSE
  17. OWNERS
  18. PREUPLOAD.cfg
  19. README.md
  20. settings.gradle
  21. THIRD_PARTY_NOTICES
README.md

Android Game SDK

Build the Game SDK

In order to build using prebuild NDK versions, this project must be initialized from a custom repo using:

mkdir android-games-sdk
cd android-games-sdk
repo init -u https://android.googlesource.com/platform/manifest -b android-games-sdk
# Or for Googlers:
# repo init -u persistent-https://googleplex-android.git.corp.google.com/platform/manifest -b android-games-sdk
repo sync -c -j8

Build with prebuilt SDKs

cd gamesdk
ANDROID_HOME=../prebuilts/sdk ./gradlew gamesdkZip

will build static and dynamic libraries for several SDK/NDK pairs.

Build with locally installed SDK/NDK

By default, the gradle script builds target archiveZip.

./gradlew archiveZip # Without Tuning Fork
./gradlew archiveTfZip # With Tuning Fork

This will use a locally installed SDK/NDK pointed to by ANDROID_HOME (and ANDROID_NDK, if the ndk isn't in ANDROID_HOME/ndk-bundle).

Tests

./gradlew localUnitTests # Requires a connected ARM64 device to run
./gradlew localDeviceInfoUnitTests # No device required, tests are running on host

Samples

Samples are classic Android projects, using CMake to build the native code. They are also all triggering the build of the Game SDK.

Using Grade command line:

cd samples/bouncyball && ./gradlew assemble
cd samples/cube && ./gradlew assemble
cd samples/tuningfork/tftestapp && ./gradlew assemble

The Android SDK/NDK exposed using environment variables (ANDROID_HOME) will be used for building both the sample project and the Game SDK.

Using Android Studio

Open projects using Android Studio:

  • samples/bouncyball
  • samples/cube
  • samples/tuningfork/tftestapp

and run them directly (Shift + F10 on Linux, Control + R on macOS). The local Android SDK/NDK (configured in Android Studio) will be used for building both the sample project and the Game SDK.

Development and debugging

After opening a sample project using Android Studio, uncomment the line containing add_gamesdk_sources(). This will add the Swappy/Tuning Fork sources as part of the project. You can then inspect the source code (with working auto completions) and run the app in debug mode (with working breakpoints and inspectors).