การเชื่อมต่อ Nearby
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
API การเชื่อมต่อ Nearby ช่วยให้แอปค้นพบ เชื่อมต่อ และแลกเปลี่ยนข้อมูลกับอุปกรณ์ที่อยู่ใกล้เคียงได้แบบเรียลไทม์ ไม่ว่าการเชื่อมต่อเครือข่ายจะเป็นอย่างไร โดยใช้บลูทูธ, Wi-Fi และเทคโนโลยีอื่นๆ
และได้รับการออกแบบมาเพื่อซ่อนความซับซ้อนของเทคโนโลยีเหล่านี้
เพื่อให้แอปสามารถมุ่งเน้นไปที่การค้นหาและการโต้ตอบกับอุปกรณ์ที่อยู่ใกล้เคียง
คุณควรเลือก API การเชื่อมต่อ Nearby สําหรับแอปของคุณเมื่อ
คุณต้องการสํารวจอุปกรณ์ที่อยู่ใกล้เคียงโดยไม่ต้องมีการเชื่อมต่ออินเทอร์เน็ต
และทําให้เกิดค่าใช้จ่ายสําหรับการส่งข้อมูลไปกลับระหว่างเครือข่าย
คุณต้องการสตรีมเนื้อหาหรือส่งเพย์โหลดที่กําหนดเองหรือไฟล์ระหว่างอุปกรณ์ที่อยู่ใกล้
คุณต้องการใช้เทคโนโลยีล่าสุดระหว่างเครื่อง เช่น Wi-Fi Aware
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-13 UTC
[null,null,["อัปเดตล่าสุด 2025-08-13 UTC"],[[["\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."]]