संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
ब्लूटूथ
पुराने वर्शन के साथ काम करने वाले एपीआई की मदद से, Android प्लैटफ़ॉर्म की ब्लूटूथ सुविधाओं का इस्तेमाल करना.
नया अपडेट |
रिलीज़ किया गया जांचा और परखा हुआ वर्शन |
रिलीज़ कैंडिडेट |
बीटा रिलीज़ |
ऐल्फ़ा रिलीज़ |
29 नवंबर, 2023 |
- |
- |
- |
1.0.0-alpha02 |
डिपेंडेंसी का एलान करना
ब्लूटूथ पर डिपेंडेंसी जोड़ने के लिए, आपको अपने प्रोजेक्ट में Google Maven रिपॉज़िटरी जोड़नी होगी. ज़्यादा जानकारी के लिए, Google की Maven रिपॉज़िटरी पढ़ें.
अपने ऐप्लिकेशन या मॉड्यूल के लिए, build.gradle
फ़ाइल में उन आर्टफ़ैक्ट की डिपेंडेंसी जोड़ें जिनकी आपको ज़रूरत है:
ग्रूवी
dependencies {
implementation "androidx.bluetooth:bluetooth:1.0.0-alpha02"
}
Kotlin
dependencies {
implementation("androidx.bluetooth:bluetooth:1.0.0-alpha02")
}
डिपेंडेंसी के बारे में ज़्यादा जानने के लिए, बिल्ड डिपेंडेंसी जोड़ना लेख पढ़ें.
सुझाव/राय दें या शिकायत करें
आपके सुझाव, शिकायत या राय से हमें Jetpack को बेहतर बनाने में मदद मिलती है. अगर आपको कोई नई समस्या मिलती है या इस लाइब्रेरी को बेहतर बनाने के लिए आपके पास कोई सुझाव है, तो हमें बताएं. नई लाइब्रेरी बनाने से पहले, कृपया इस लाइब्रेरी में मौजूद मौजूदा समस्याओं पर एक नज़र डालें. किसी मौजूदा समस्या पर अपना वोट जोड़ने के लिए, स्टार बटन पर क्लिक करें.
नई समस्या बनाना
ज़्यादा जानकारी के लिए, समस्या ट्रैकर का दस्तावेज़ देखें.
इस आर्टफ़ैक्ट के लिए रिलीज़ नोट उपलब्ध नहीं हैं.
वर्शन 1.0
वर्शन 1.0.0-alpha02
29 नवंबर, 2023
androidx.bluetooth:bluetooth:1.0.0-alpha02
और androidx.bluetooth:bluetooth-testing:1.0.0-alpha02
रिलीज़ हो गए हैं. 1.0.0-alpha02 वर्शन में ये बदलाव शामिल हैं.
नई सुविधाएं
minSdkVersion
को 21 पर सेट करें
एपीआई में हुए बदलाव
GattServerConnectFlow#updateServices
, सस्पेंड फ़ंक्शन बन जाता है (I0237d)
AdvertiseParams.durationMillis
को लॉन्ग (If6771) में बदलें
openGattServer
को Flow (Icef54) में बदलना
- स्कैन न हो पाने पर
ScanException
दिखाएं और स्कैनर को डिफ़ॉल्ट रूप से setLegacy(false)
पर सेट करें (Ib337c)
- विज्ञापन दिखाने में हुई गड़बड़ी पर
AdvertiseException
दिखाएं (I0e691)
- ब्लूटूथ से जुड़ा सामान्य अपवाद जोड़ें (I0130d)
- विज्ञापन को फ़्लो में बदलना और ज़्यादा से ज़्यादा अवधि बदलना (I32fd8)
ScanResult
(I6d7f0) में serviceData
और serviceSolicitationUuids
जोड़ें
durationMillis
को लंबी से अवधि (I89d49) में बदलें
ScanResult
में rssi और periodicAdvertisingInterval
जोड़ें (I60b51)
ScanFilter
में serviceSolicitationUuid
और solicitationUuidMask
जोड़ें (Ic2206)
GattServerSessionScope#subscribedCharacteristics
(I0edab) जोड़ा गया
serviceSolicitationUuids
को AdvertiseParams
में जोड़ें (Ic9aa7)
AdvertiseParams.durationMillis
को Int से Long (I6873f) में बदलें
GattServerSessionScope#notify
कोई वैल्यू नहीं दिखाता, लेकिन काम न करने पर अपवाद दिखाता है (Ifc26f)
गड़बड़ियां ठीक की गईं
- स्कैन करने की सुविधा को एक्सट्रैक्ट करना (I4d43f)
वर्शन 1.0.0-alpha01
20 सितंबर, 2023
androidx.bluetooth:bluetooth:1.0.0-alpha01
और androidx.bluetooth:bluetooth-testing:1.0.0-alpha01
रिलीज़ हो गए हैं. 1.0.0-alpha01 वर्शन में ये कमिट शामिल हैं.
नई सुविधाएं
- यह AndroidX ब्लूटूथ एपीआई की शुरुआती रिलीज़ है. इसमें Kotlin API का एक प्लैटफ़ॉर्म दिया गया है, जो ब्लूटूथ एलई स्कैनिंग और विज्ञापन दिखाने की सुविधा के साथ-साथ GATT क्लाइंट और सर्वर के इस्तेमाल के उदाहरणों को कवर करता है. यह कम से कम एपीआई प्लैटफ़ॉर्म, एसिंक्रोनस और सिंक ऑपरेशन के साथ साफ़ थ्रेड मॉडल उपलब्ध कराता है. साथ ही, यह पक्का करता है कि सभी तरीके लागू किए जाएं और नतीजे मिलें.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, 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."]]