If you're using CMake, see the gamesdk/samples/bouncyball/app/CMakeLists.txt
file in the downloaded SDK for an example CMake configuration. It includes a
utility file called gamesdk/samples/gamesdk.cmake, which performs final
checks, adds the proper compiler include paths, and generates a target that you
can use to link the library.
To use the gamesdk.cmake utility:
Include this file in your CMakeLists.txt:
// Use a relative or absolute path. For example, /home/yourusername/gamesdk
// or C:\Android\gamesdk.
include("path/to/gamesdk/samples/gamesdk.cmake")
gamesdk가 포함된 폴더를 사용하여 add_gamesdk_target 함수 호출:
// Use a relative or absolute path.
add_gamesdk_target(PACKAGE_DIR path/to/gamesdk)
Oboe로 오디오를 재생하거나 녹음하려면 하나 이상의 오디오 스트림을 만들어 활성화하고 콜백을 사용하여 오디오 입력/출력 기기와 앱 간에 오디오를 교환합니다. Oboe 사용을 참고하세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-26(UTC)"],[],[],null,["There are two ways to incorporate the Oboe library into your project.\n\n- [Integrate Oboe with Gradle and CMake](#integrate-native)\n\n- [Download the Android Game SDK and integrate Oboe manually](#integrate-download)\n\nIntegrate Oboe with Gradle and CMake\n\nThese instructions are for projects using [Android Gradle plugin version 4.1.0 or higher](/studio/releases/gradle-plugin)\nusing [native dependencies](/studio/build/dependencies#using-native-dependencies?buildsystem=cmake)\nwith CMake.\n\nIf your project is using either the Android Gradle plugin version 4.0 or\n`ndk-build` instead of CMake, the process is slightly different. See [Using native dependencies](/studio/build/dependencies#using-native-dependencies?buildsystem=ndk-build&agpversion=4.0).\n| **Note:** Native dependencies have minimum version requirements for Gradle and the Android Gradle plugin. If you have an existing project, you may need to update the project Gradle version to 6.5.0 or later and the Android Gradle plugin version to 4.1.0 or later. For more information on updating these versions, see [Android Gradle plugin release notes](/studio/releases/gradle-plugin).\n\nUpdate build.gradle\n\nTo add Oboe to your app while using Android Gradle plugin version 4.1.0 or\nhigher, make the following additions to your app's `build.gradle` file.\n\n1. Add the `oboe` dependency to the `dependencies` section. If necessary,\n replace `1.5.0` with the [latest stable version](https://github.com/google/oboe/releases/)\n of Oboe:\n\n dependencies {\n implementation 'com.google.oboe:oboe:1.5.0'\n }\n\n2. Enable the `prefab` option in the `buildFeatures` section.\n\n android {\n buildFeatures {\n prefab true\n }\n }\n\n3. Configure your app to use the shared STL:\n\n android {\n defaultConfig {\n externalNativeBuild {\n cmake {\n arguments \"-DANDROID_STL=c++_shared\"\n }\n }\n }\n }\n\nUpdate CMakeLists.txt\n\nAdding Oboe requires two additions to your app's `CMakeLists.txt` file.\n\n1. Add the following `find_package` command:\n\n find_package (oboe REQUIRED CONFIG)\n\n2. Add `oboe::oboe` to the list of libraries passed to the\n `target_link_libraries` command associated with your main executable.\n\nIntegrate with the Android Game SDK\n\n1. [Download the library](https://developer.android.com/games/sdk) and check\n it into your source control system.\n\n2. Make the following changes to your project's build settings.\n\n| **Note:** To use Oboe, you must specify a minimum API level of 16 and NDK release of 18 for the Android Game SDK libraries. If you don't, Oboe can't be found at build time.\n\nStatic library\n\nWhen you integrate with the Android Game SDK, you statically link to a version\nof the Oboe library compiled for the given ABI, API level, NDK, and STL\ncombination:\n\n1. Add `gamesdk/include` to your compiler include paths.\n2. Add a path of the following form in your linker library paths:\n\n ```\n gamesdk/libs/architecture_APIapiLevel_NDKndkVersion_stlVersion_Release\n ```\n\n For example: `gamesdk/libs/arm64-v8a_API24_NDK18_cpp_static_Release`\n3. Add `-loboe_static` to your linker command.\n\nYou don't need to bundle the `liboboe.so` shared library, which means static\nlinking gives you a much smaller code footprint.\n\nShared library\n\nIf the ABI, API level, NDK, and STL combination required for a static library\nisn't available for your settings, you can link against the shared library\ninstead:\n\n1. Follow steps 1 and 2 from the previous section (about the static library) to\n update your compiler include paths, and use the appropriate header file.\n\n2. Add a path of the following form in your linker library paths:\n\n \u003cbr /\u003e\n\n ```\n gamesdk/libs/architectureAPI\u003cvar translate=\"no\"\u003eapiLevel\u003c/var\u003eNDKndkVersion_stlVersion_Release/lib/oboe\n ```\n3. Add `-loboe -lOpenSLES` to your linker command.\n\nUsing CMake (static library only)\n\nIf you're using CMake, see the `gamesdk/samples/bouncyball/app/CMakeLists.txt`\nfile in the downloaded SDK for an example CMake configuration. It includes a\nutility file called `gamesdk/samples/gamesdk.cmake`, which performs final\nchecks, adds the proper compiler include paths, and generates a target that you\ncan use to link the library.\n\nTo use the `gamesdk.cmake` utility:\n\n1. Include this file in your `CMakeLists.txt`:\n\n // Use a relative or absolute path. For example, /home/yourusername/gamesdk\n // or C:\\Android\\gamesdk.\n include(\"\u003cvar translate=\"no\"\u003epath/to/gamesdk\u003c/var\u003e/samples/gamesdk.cmake\")\n\n2. Call the `add_gamesdk_target` function with the folder containing\n the gamesdk:\n\n // Use a relative or absolute path.\n add_gamesdk_target(PACKAGE_DIR \u003cvar translate=\"no\"\u003epath/to/gamesdk\u003c/var\u003e)\n\n3. In your `target_link_libraries` for your native library, add\n `oboe` as a dependency:\n\n // The casing of OpenSLES is important.\n target_link_libraries(native-lib oboe OpenSLES ...) \n\nFor advanced usage of CMake, see the [`gamesdk.cmake`](https://android.googlesource.com/platform/frameworks/opt/gamesdk/+/refs/heads/master/samples/gamesdk.cmake)\nsource file.\n\nNext steps: using Oboe\n\nTo play or record audio with Oboe, create and activate one or more audio\nstreams, and use callbacks to exchange audio between your audio input/output\ndevices and your app. See [Using\nOboe](https://github.com/google/oboe/blob/master/docs/GettingStarted.md#using-%0Aoboe)."]]