Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Cihazlar arası SDK geliştirici önizlemesi bir açık kaynak
inceleyebilirsiniz. Bu önizleme, geliştirici topluluğunun prototip oluşturmasına ve
çoklu cihaz deneyimlerini doğrular ancak üretimde kullanılmak üzere tasarlanmamıştır
izin verir.
Beta Programı'na kaydolup uygulamanızın uygun beta sürümünü yükledikten
Google Play Hizmetleri, farklı cihaz deneyimleri geliştirmeye hazırsınız
test edebilirsiniz.
Bağımlılıklar ve izinler
İlk olarak uygulama modülü build.gradle dosyanızı açın ve
Aşağıdaki gibi cihazlar arası SDK:
Geliştirici Önizlemesi sırasında API değiştirilebilir. Bu nedenle sürüm notlarını kontrol edin
cihazlar arası SDK'nın en yeni sürümünü kullandığınızdan emin olun.
Cihazlar arası SDK'yı kullanmanın avantajlarından biri
BLUETOOTH_CONNECT, BLUETOOTH_SCAN ve
ACCESS_FINE_LOCATION.
Cihazlar arası API'ler
Cihazlar arası SDK'daki her API,
çoklu cihaz çerçevesi:
Cihaz bulma: Yakındaki cihazları kolayca bulun, eşler arası eşlemeyi yetkilendirin
iletişim kurmak ve alıcı cihazda hedef uygulamayı başlatmaktır.
Güvenli iletişim: Şifrelenmiş, düşük gecikmeli, çift yönlü verileri etkinleştirin
yetkili cihazlar arasında paylaşım yapabilirsiniz.
Birden fazla cihaz oturumu: Bir uygulamanın kullanıcı deneyimini aktarın veya genişletin
cihazlarda kullanabilirsiniz.
Bu API'ler Discovery ve Sessions sınıfları aracılığıyla kullanılabilir:
Bu API'lerin kullanım alanları hakkında daha fazla bilgiyi aşağıda bulabilirsiniz.
veya
örnek uygulama deposunu ziyaret edin.
Örnek Uygulamalar
Cihazlar arası SDK'nın işleyiş şeklini göstermek için çok sayıda uygulama hazırladık.
Bu örnek uygulamalar basit bir Taş, Kağıt, Makas oyunuyla oluşturulmuştur.
öğrenmenin en kolay yoludur. Biz
nasıl kullanılacağını görmek için örnek kodu incelemenizi ve değiştirmenizi öneririz:
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-27 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-27 UTC."],[],[],null,["# Get started\n\nThe Cross device SDK Developer Preview is distributed through an [open-source\nproject](https://github.com/google/cross-device-sdk). This preview is available for the developer community to prototype and\nvalidate multidevice experiences but is not intended for use in production\napplications.\n| **Note:** Quick Share must be turned on to use the Cross device SDK. See [Share files and links with nearby devices](https://support.google.com/android/answer/9286773) to learn more.\n\nSet up Google Play Services\n---------------------------\n\nBefore you start coding,\n[ensure Google Play Services is installed](https://developers.google.com/android/guides/setup#check-whether-installed).\nThe Cross device SDK is in Developer Preview and is available only through the\nGoogle Play Services Beta Program. See\n[this guide](https://developers.google.com/android/guides/beta-program) on how\nto enroll in the Beta Program.\n\nOnce you enroll in the Beta Program and install the appropriate beta version of\nGoogle Play Services, you're ready to begin developing multidevice experiences\nwith the Cross device SDK.\n\nDependencies and permissions\n----------------------------\n\nFirst, open your app module `build.gradle` file and add a dependency on the\nCross device SDK as follows: \n\n dependencies {\n implementation 'com.google.ambient.crossdevice:crossdevice:0.1.0-preview01'\n }\n\nDuring Developer Preview, the API is subject to change, so check release notes\nregularly to ensure you're using the latest version of the Cross device SDK.\n\nOne of the benefits of using the Cross device SDK is that it abstracts away\nlocal discovery, such as `BLUETOOTH_CONNECT`, `BLUETOOTH_SCAN`, and\n`ACCESS_FINE_LOCATION`.\n| **Note:** You still have to declare and request runtime permissions required by your app features and API outside of the Cross device SDK. For instance, you might need `BLUETOOTH_SCAN` permission to perform a Bluetooth scan outside of the Cross device SDK.\n\nCross device APIs\n-----------------\n\nEach API in the Cross device SDK is aimed at solving a common task within a\nmultidevice framework:\n\n- Device discovery: Easily find nearby devices, authorize peer-to-peer communication, and start the target application on the receiving device.\n- Secure communications: Enable encrypted, low-latency, bi-directional data sharing between authorized devices.\n- Multidevice sessions: Transfer or extend an application's user-experience across devices.\n\nThese APIs are available through the `Discovery` and `Sessions` classes: \n\n### Kotlin\n\n```kotlin\nval discovery = Discovery.create(context)\nval sessions = Sessions.create(context)\n```\n\n### Java\n\n```java\nDiscovery discovery = Discovery.create(context);\nSessions sessions = Sessions.create(context);\n```\n\nYou can learn more about the specific uses of these APIs in the following\nsections, or refer to our\n[sample app repository](https://github.com/android/connectivity-samples).\n| **Note:** The Cross device SDK is asynchronous by design. If you are unfamiliar with asynchronous operations, we encourage you to learn about [`Coroutines`](https://kotlinlang.org/docs/coroutines-guide.html) for Kotlin or [`ListenableFuture`](https://developer.android.com/guide/background/listenablefuture) for Java.\n\nSample Applications\n-------------------\n\nWe've prepared a number of apps to demonstrate the Cross device SDK in action.\nThese sample apps are built around a simple Rock, Paper, Scissors game as an\nintuitive and interactive way to familiarize yourself with the APIs. We\nencourage you to explore and modify the sample code to see how to use:\n\n- Device Discovery\n- Secure Connections\n- Sessions Transfer\n- Shared Sessions\n\nCheck out\n[Cross-device Rock, Paper, Scissors on Github](https://github.com/android/connectivity-samples/tree/main/CrossDeviceRockPaperScissors)."]]