คู่มือการเชื่อมต่อ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แอปสามารถเชื่อมต่อกับโลกภายนอกได้โดยใช้เทคโนโลยีการสื่อสารที่หลากหลาย เช่น Wi-Fi, บลูทูธ และ USB คำแนะนำที่ระบุไว้ด้านล่างครอบคลุมการเพิ่มการรองรับเทคโนโลยีเหล่านี้และการเพิ่มประสิทธิภาพแอปเพื่อการเชื่อมต่อ
เทคโนโลยีที่รองรับ
Android รองรับโปรโตคอลและเฟรมเวิร์กต่อไปนี้สำหรับการเชื่อมต่ออุปกรณ์กับโลกภายนอก
เส้นนำ |
เครือข่าย: ภาพรวม |
ภาพรวมของคู่มือที่ครอบคลุมการดำเนินการต่างๆ ของเครือข่าย ซึ่งรวมถึงการเชื่อมต่อ การจัดการ การแยกวิเคราะห์ XML การตรวจสอบ และอื่นๆ |
เครือข่าย: 5G |
ใช้ประโยชน์จากเครือข่าย 5G |
เครือข่าย: VPN |
พัฒนาและทดสอบไคลเอ็นต์เครือข่ายส่วนตัวเสมือน (VPN) ของคุณเองสำหรับอุปกรณ์ที่ใช้ Android |
เครือข่าย: การสแกนหา Wi-Fi |
ดูรายการจุดเข้าใช้งาน Wi-Fi ที่มองเห็นได้จากอุปกรณ์ |
เครือข่าย: Wi-Fi Direct (P2P) |
เชื่อมต่ออุปกรณ์ที่รองรับโดยตรงโดยไม่ต้องใช้จุดเข้าใช้งานกลาง |
เครือข่าย: Wi-Fi Aware |
เปิดใช้อุปกรณ์ที่ใช้ Android 8.0 (API ระดับ 26) ขึ้นไปเพื่อค้นหาและเชื่อมต่อกับอุปกรณ์เครื่องอื่นโดยตรงโดยไม่ต้องมีการเชื่อมต่อประเภทอื่นระหว่างอุปกรณ์ หรือที่เรียกว่า Neighbor Awareness Networking (NAN) |
เครือข่าย: ระยะเวลารับส่งข้อมูล (RTT) ของ Wi-Fi |
วัดระยะทางไปยังจุดเข้าใช้งาน Wi-Fi ที่ใช้ RTT ได้และอุปกรณ์ Wi-Fi Aware ของบุคคลอื่นที่อยู่ใกล้เคียง |
เครือข่าย: ฮอตสปอต Wi-Fi ในพื้นที่เท่านั้น |
เปิดใช้แอปในอุปกรณ์ที่เชื่อมต่อกับฮอตสปอต Wi-Fi เพื่อให้สื่อสารกันได้ |
บลูทูธ: ภาพรวม |
ภาพรวมการรองรับบลูทูธของ Android รวมถึงข้อมูลเบื้องต้นและคลาสและอินเทอร์เฟซหลัก |
บลูทูธ: บลูทูธคลาสสิก |
ตั้งค่าการเชื่อมต่อบลูทูธพื้นฐานในแอป |
บลูทูธ: บลูทูธพลังงานต่ำ (BLE) |
โอนข้อมูลจำนวนเล็กน้อยระหว่างอุปกรณ์ที่อยู่ใกล้เคียงและโต้ตอบกับเซ็นเซอร์ตรวจหาบุคคลในบริเวณใกล้เคียง |
บลูทูธ: BLE Audio |
รับเสียงคุณภาพสูงโดยไม่เสียอายุการใช้งานแบตเตอรี่ และช่วยให้ผู้ใช้สลับระหว่างกรณีการใช้งานต่างๆ ได้อย่างราบรื่น |
Near Field Communication (NFC) |
NFC คือชุดเทคโนโลยีไร้สายระยะสั้น ซึ่งโดยทั่วไปต้องใช้ระยะห่างไม่เกิน 4 ซม. เพื่อเริ่มต้นการเชื่อมต่อ |
การระบุตำแหน่ง |
จัดการเซสชันช่วงสัญญาณในเทคโนโลยีต่างๆ |
โทรคมนาคม |
จัดการการโทรด้วยเสียงและวิดีโอ รวมถึง eSIM และซิมการ์ด |
การสื่อสารด้วยแถบความถี่กว้างยิ่งยวด (UWB) |
วัดระยะทางระหว่างอุปกรณ์ได้อย่างแม่นยำ |
USB |
ใช้โหมดอุปกรณ์เสริม USB และโหมดโฮสต์ USB เพื่อรองรับอุปกรณ์ต่อพ่วง USB และอุปกรณ์เสริม USB ของ Android ที่หลากหลาย |
การเพิ่มประสิทธิภาพ
คู่มือต่อไปนี้จะช่วยคุณเพิ่มประสิทธิภาพแอปเพื่อการเชื่อมต่อ
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา 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,["# Connectivity guides\n\nYour app can connect with the outside world using a variety of different\ncommunication technologies, including Wi-Fi, Bluetooth, and USB. The guides\nlisted below cover adding support for these technologies and for optimizing\nyour app for connectivity.\n\nSupported technologies\n----------------------\n\nAndroid supports the following protocols and frameworks for connecting your\ndevice to the outside world.\n\n| Guides ||\n|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Networks: [**Overview**](/develop/connectivity/network-ops) | Overview of guides that cover performing various network operations, including connections, management, parsing XML, monitoring, and more. |\n| Networks: [**5G**](/develop/connectivity/5g/enhance-with-5g) | Take advantage of 5G networking. |\n| Networks: [**VPN**](/develop/connectivity/vpn) | Develop and test your own virtual private network (VPN) client for an Android-powered device. |\n| Networks: [**Wi-Fi scanning**](/develop/connectivity/wifi-scan) | Get a list of Wi-Fi access points visible from a device. |\n| Networks: [**Wi-Fi Direct (P2P)**](/develop/connectivity/wifip2p) | Connect supported devices directly to each other without an intermediate access point. |\n| Networks: [**Wi-Fi Aware**](/develop/connectivity/wifi-aware) | Enable devices running Android 8.0 (API level 26) and higher to discover and connect directly to each other without any other type of connectivity between them. Also known as Neighbor Awareness Networking (NAN). |\n| Networks: [**Wi-Fi Round-Trip Time (RTT)**](/develop/connectivity/wifi-rtt) | Measure the distance to nearby RTT-capable Wi-Fi access points and peer Wi-Fi Aware devices. |\n| Networks: [**Wi-Fi local-only hotspot**](/develop/connectivity/localonlyhotspot) | Enable apps on devices connected to a Wi-Fi hotspot to communicate with each other. |\n| Bluetooth: [**Overview**](/develop/connectivity/bluetooth) | Overview of Android Bluetooth support, including basics and key classes and interfaces. |\n| Bluetooth: [**Bluetooth Classic**](/develop/connectivity/bluetooth/setup) | Set up baseline Bluetooth connectivity on your app. |\n| Bluetooth: [**Bluetooth Low Energy (BLE)**](/develop/connectivity/bluetooth/ble/ble-overview) | Transfer small amounts of data between nearby devices and interacting with proximity sensors. |\n| Bluetooth: [**BLE Audio**](/develop/connectivity/bluetooth/ble-audio/overview) | Receive high fidelity audio without sacrificing battery life, and let users seamlessly switch between different use cases. |\n| [**Near Field Communication (NFC)**](/develop/connectivity/nfc) | NFC is a set of short-range wireless technologies, typically requiring a distance of 4 cm or less to initiate a connection. |\n| [**Ranging**](/develop/connectivity/ranging) | Handle ranging sessions across multiple technologies. |\n| [**Telecom**](/develop/connectivity/telecom) | Manage audio and video calls, including eSIMs and SIM cards. |\n| [**Ultra Wideband (UWB) communication**](/develop/connectivity/uwb) | Measure precise ranging between devices. |\n| [**USB**](/develop/connectivity/usb) | Use USB accessory and USB host modes to support a variety of USB peripherals and Android USB accessories. |\n\nOptimizations\n-------------\n\nThe following guides can help you optimize your app for connectivity.\n\n| Guides ||\n|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| [Reduce network battery drainage](/develop/connectivity/preserving-battery) | Learn about strategies for preserving battery, user experience, and system health. |\n| [Reduce latency and increase network throughput](/develop/connectivity/cronet) | Learn how to use Cronet, a library derived from the Chromium network stack, to reduce latency and increase throughput of network requests. |"]]