android o wifi 感知,Android上的Wifi感知与Wifi P2P之间有何区别?
根據(jù)Android文檔,使用Wi-Fi Aware,您可以在服務(wù)發(fā)現(xiàn)階段在設(shè)備之間發(fā)送數(shù)據(jù)(僅輕量級(jí)!最大255個(gè)字節(jié)),并且在需要時(shí)可以打開設(shè)備之間的連接以發(fā)送更大的數(shù)據(jù).使用Wi-Fi對(duì)等網(wǎng)絡(luò)時(shí),必須先執(zhí)行某種身份驗(yàn)證,然后再打開套接字,然后才能在設(shè)備之間發(fā)送數(shù)據(jù).
The Wi-Fi Aware APIs let apps perform the following operations:
Discover other devices: […] After the subscriber discovers a publisher, the subscriber can either send a short message or establish a network connection with the discovered device.
Create a network connection: After two devices have discovered each other […] they can create a bi-directional Wi-Fi Aware network connection without an access point.
Note: Messages are generally used for lightweight messaging, as they might not be delivered (or be delivered out-of-order or more than once) and are limited to about 255 bytes in length.
此外,使用Wi-Fi Aware,開發(fā)人員可以在DiscoverySession類的createNetworkSpecifierOpen()方法和createNetworkSpecifierPassphrase()方法之間進(jìn)行選擇,以分別打開設(shè)備之間的未加密或加密連接.
使用Wi-Fi對(duì)等時(shí),開發(fā)人員除了WifiP2PManager.connect()方法外別無選擇.調(diào)用它會(huì)在所連接的設(shè)備上觸發(fā)一個(gè)對(duì)話框(按鈕配置),并且僅當(dāng)兩個(gè)設(shè)備首次相互連接時(shí)才會(huì)出現(xiàn)該對(duì)話框.順便說一句…修改WifiP2pConfig的WpsInfo是沒有用的.它將始終使用“按鈕配置”選項(xiàng).
總結(jié)
以上是生活随笔為你收集整理的android o wifi 感知,Android上的Wifi感知与Wifi P2P之间有何区别?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android 时间转换 工具下载,时间
- 下一篇: 百度地图android wear,And