加入我們的
郵寄清單,取得關於「鄰近分享」的最新消息和公告。
鄰近分享連線
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
無論網路連線能力為何,Nearby Connections API 都能讓應用程式即時探索、連線及交換鄰近裝置的資料。這項功能採用藍牙、Wi-Fi 和其他技術,可隱藏這些技術的複雜性,因此您的應用程式可專注於探索鄰近裝置並進行互動。
在下列情況下,您應該為應用程式選擇 Nearby Connections API:
您想要在不連上網際網路的情況下找到鄰近裝置,且每項作業都會產生網路往返費用。
您想要串流附近的內容,或在不同裝置之間傳輸任意酬載或檔案。
您想要使用最新的點對點技術,例如 Wi-Fi Aware (如有)。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-13 (世界標準時間)。
[null,null,["上次更新時間:2025-08-13 (世界標準時間)。"],[[["\u003cp\u003eThe Nearby Connections API enables real-time data exchange between devices, regardless of internet access, using Bluetooth, Wi-Fi, and other technologies.\u003c/p\u003e\n"],["\u003cp\u003eThis API simplifies device discovery and interaction by abstracting away underlying technology complexities.\u003c/p\u003e\n"],["\u003cp\u003eChoose this API for scenarios requiring offline device discovery, content streaming, or leveraging peer-to-peer technologies like Wi-Fi Aware.\u003c/p\u003e\n"]]],[],null,["# Nearby Connections\n\nThe [Nearby Connections API](/nearby/connections/overview) allows apps to\ndiscover, connect to, and exchange data with nearby devices in real-time,\nregardless of network connectivity. It uses Bluetooth, Wi-Fi, and other\ntechnologies, and is designed to hide the complexity of these technologies\nso your app can focus on discovering and interacting with nearby devices.\n\nYou should choose the Nearby Connections API for your app when:\n\n- You want to discover nearby devices without requiring Internet connectivity\n and incurring the cost of a network round-trip on each operation.\n\n- You want to stream content or transmit arbitrary payloads or files between\n nearby devices.\n\n- You want to use the latest peer-to-peer technologies such as\n [Wi-Fi Aware](//developer.android.com/guide/topics/connectivity/wifi-aware)\n when available."]]