컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
블루투스
하위 호환 API를 사용하여 Android 플랫폼의 블루투스 기능을 사용합니다.
최근 업데이트 |
안정화 버전 |
출시 후보 버전 |
베타 버전 |
알파 버전 |
2023년 11월 29일 |
- |
- |
- |
1.0.0-alpha02 |
종속 항목 선언
블루투스의 종속 항목을 추가하려면 프로젝트에 Google Maven 저장소를 추가해야 합니다. 자세한 내용은 Google Maven 저장소를 읽어보세요.
다음과 같이 앱 또는 모듈의 build.gradle
파일에 필요한 아티팩트의 종속 항목을 추가합니다.
Groovy
dependencies {
implementation "androidx.bluetooth:bluetooth:1.0.0-alpha02"
}
Kotlin
dependencies {
implementation("androidx.bluetooth:bluetooth:1.0.0-alpha02")
}
종속 항목에 관한 자세한 내용은 빌드 종속 항목 추가를 참고하세요.
의견
제출하신 의견은 Jetpack을 개선하는 데 도움이 됩니다. 새로운 문제를 발견하거나 라이브러리 개선을 위한 아이디어가 있다면 Google에 알려 주세요. 새 문제를 제출하기 전에 이 라이브러리의 기존 문제를 살펴보시기 바랍니다. 별표 버튼을 클릭하여 기존 문제에 투표할 수 있습니다.
새로운 문제 제출하기
자세한 내용은 Issue Tracker 문서를 참고하세요.
이 아티팩트의 출시 노트는 없습니다.
버전 1.0
버전 1.0.0-alpha02
2023년 11월 29일
androidx.bluetooth:bluetooth:1.0.0-alpha02
및 androidx.bluetooth:bluetooth-testing:1.0.0-alpha02
이 출시되었습니다. 버전 1.0.0-alpha02에 포함된 커밋을 확인하세요.
새로운 기능
API 변경사항
GattServerConnectFlow#updateServices
가 정지 함수가 됩니다. (I0237d)
AdvertiseParams.durationMillis
를 Long으로 변경 (If6771)
openGattServer
를 Flow로 변환합니다. (Icef54)
- 스캔 실패 시
ScanException
을 발생시키고 기본적으로 스캐너를 setLegacy(false)
로 설정합니다. (Ib337c)
- 광고 실패 시
AdvertiseException
이 발생합니다. (I0e691)
- 포착할 일반적인 블루투스 예외를 추가했습니다. (I0130d)
- 광고를 흐름으로 변환하고 최대 재생 시간을 변경합니다. (I32fd8)
ScanResult
에 serviceData
및 serviceSolicitationUuids
를 추가했습니다. (I6d7f0)
durationMillis
를 Long에서 Duration으로 변경했습니다. (I89d49)
ScanResult
에 rssi 및 periodicAdvertisingInterval
를 추가했습니다. (I60b51)
ScanFilter
에 serviceSolicitationUuid
및 solicitationUuidMask
를 추가했습니다. (Ic2206)
GattServerSessionScope#subscribedCharacteristics
를 추가했습니다. (I0edab)
AdvertiseParams
에 serviceSolicitationUuids
를 추가합니다. (Ic9aa7)
AdvertiseParams.durationMillis
를 Int에서 Long으로 변경했습니다. (I6873f)
GattServerSessionScope#notify
가 반환되지 않고 실패하면 예외가 발생합니다. (Ifc26f)
버그 수정
버전 1.0.0-alpha01
2023년 9월 20일
androidx.bluetooth:bluetooth:1.0.0-alpha01
및 androidx.bluetooth:bluetooth-testing:1.0.0-alpha01
이 출시되었습니다. 버전 1.0.0-alpha01에 포함된 커밋을 확인하세요.
새로운 기능
- 이 버전은 블루투스 LE 스캔 및 광고, GATT 클라이언트 및 서버 사용 사례를 다루는 Kotlin API 노출 영역을 제공하는 AndroidX 블루투스 API의 초기 출시 버전입니다. 최소한의 API 노출 영역, 비동기 및 동기 작업이 포함된 명확한 스레드 모델을 제공하고 모든 메서드가 실행되고 결과를 제공하도록 합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(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-07-27(UTC)"],[],[],null,["# bluetooth\n=========\n\nAPI Reference \n[androidx.bluetooth](/reference/kotlin/androidx/bluetooth/package-summary) \nUse the Android platform's Bluetooth features with backward-compatible APIs. \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|-------------------|----------------|-------------------|--------------|---------------------------------------------------------------------|\n| November 29, 2023 | - | - | - | [1.0.0-alpha02](/jetpack/androidx/releases/bluetooth#1.0.0-alpha02) |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on Bluetooth, you must add the Google Maven repository to your\nproject. Read [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\n### Groovy\n\n```groovy\ndependencies {\n \n implementation \"androidx.bluetooth:bluetooth:1.0.0-alpha02\"\n}\n```\n\n### Kotlin\n\n```kotlin\ndependencies {\n \n implementation(\"androidx.bluetooth:bluetooth:1.0.0-alpha02\")\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n--------\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:1190075%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=1190075&template=1683949)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nThere are no release notes for this artifact.\n\nVersion 1.0\n-----------\n\n### Version 1.0.0-alpha02\n\nNovember 29, 2023\n\n`androidx.bluetooth:bluetooth:1.0.0-alpha02` and `androidx.bluetooth:bluetooth-testing:1.0.0-alpha02` are released. [Version 1.0.0-alpha02 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/91bb8c1f81dcb031bda00fcd8e55f1e890b56f06..b5166f9a1e9c047162d1215884c3e2cd41a4a74a/bluetooth)\n\n**New Features**\n\n- Lower `minSdkVersion` to 21\n\n**API Changes**\n\n- `GattServerConnectFlow#updateServices` becomes a suspend function ([I0237d](https://android-review.googlesource.com/#/q/I0237d90173df024f4052a781ba41dd72a9a54343))\n- Change `AdvertiseParams.durationMillis` to Long ([If6771](https://android-review.googlesource.com/#/q/If6771fb2a9de564dd194d62bf100420e4b6a16d0))\n- Convert `openGattServer` to Flow ([Icef54](https://android-review.googlesource.com/#/q/Icef5495059e5fd5d7db9aa1eed779b798142d2d8))\n- Throw `ScanException` on scan fail and set scanner to `setLegacy(false)` by default ([Ib337c](https://android-review.googlesource.com/#/q/Ib337c25327a8c2a9611352b804a8ae6c71a99656))\n- Throw `AdvertiseException` on advertise fail ([I0e691](https://android-review.googlesource.com/#/q/I0e691b67dfb11f0e67e6c61845f38b5a2bcfd44c))\n- Add general bluetooth exception to catch ([I0130d](https://android-review.googlesource.com/#/q/I0130d754ada8ec78577936ca65bbd56f97feb69c))\n- Convert advertise to Flow and change maximum duration ([I32fd8](https://android-review.googlesource.com/#/q/I32fd8522085028d20735749cd9ca2f18fcae9851))\n- Add `serviceData` and `serviceSolicitationUuids` to `ScanResult` ([I6d7f0](https://android-review.googlesource.com/#/q/I6d7f0a36e15b168a374ad3ea8d28f18bc6b7cb79))\n- Change `durationMillis` from Long to Duration ([I89d49](https://android-review.googlesource.com/#/q/I89d4936165a43600862521673605d2e533bc9677))\n- Add rssi, and `periodicAdvertisingInterval` to `ScanResult` ([I60b51](https://android-review.googlesource.com/#/q/I60b514a7893ec07bcc0eec2a8706e635c4c51c1f))\n- Add `serviceSolicitationUuid` and `solicitationUuidMask` to `ScanFilter` ([Ic2206](https://android-review.googlesource.com/#/q/Ic220683ef400b7d707424b250ef497194fad450d))\n- Added `GattServerSessionScope#subscribedCharacteristics` ([I0edab](https://android-review.googlesource.com/#/q/I0edabd53e1af3dcd64abd42470887a36de236144))\n- Add `serviceSolicitationUuids` to `AdvertiseParams` ([Ic9aa7](https://android-review.googlesource.com/#/q/Ic9aa78cad8da049ccfabbe48f468e5e193fbaad0))\n- Change `AdvertiseParams.durationMillis` from Int to Long ([I6873f](https://android-review.googlesource.com/#/q/I6873f3b2c222f02ab0f53c04e66c23a6106d86a5))\n- `GattServerSessionScope#notify` does not return but throws an exception if it fails ([Ifc26f](https://android-review.googlesource.com/#/q/Ifc26fac2a3b8fbd0aa404fb4e6d5d9fa4c59f9d5))\n\n**Bug Fixes**\n\n- Extract scan functionality ([I4d43f](https://android-review.googlesource.com/#/q/I4d43f370b201c942bea0eda1230fef7ff6ef8aca))\n\n### Version 1.0.0-alpha01\n\nSeptember 20, 2023\n\n`androidx.bluetooth:bluetooth:1.0.0-alpha01` and `androidx.bluetooth:bluetooth-testing:1.0.0-alpha01` are released. [Version 1.0.0-alpha01 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/91bb8c1f81dcb031bda00fcd8e55f1e890b56f06/bluetooth)\n\n**New Features**\n\n- This is the initial release of AndroidX Bluetooth APIs that provides a Kotlin API surface covering Bluetooth LE scanning and advertising, and GATT client and server use cases. It provides a minimal API surface, clear thread model with async and sync operations, and ensures all methods be executed and provides the results."]]