android o wifi 感知,Android上的Wifi感知与Wifi P2P之间有何区别?

根据Android文档,使用Wi-Fi Aware,您可以在服务发现阶段在设备之间发送数据(仅轻量级!最大255个字节),并且在需要时可以打开设备之间的连接以发送更大的数据.使用Wi-Fi对等网络时,必须先执行某种身份验证,然后再打开套接字,然后才能在设备之间发送数据.

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,开发人员可以在DiscoverySession类的createNetworkSpecifierOpen()方法和createNetworkSpecifierPassphrase()方法之间进行选择,以分别打开设备之间的未加密或加密连接.

使用Wi-Fi对等时,开发人员除了WifiP2PManager.connect()方法外别无选择.调用它会在所连接的设备上触发一个对话框(按钮配置),并且仅当两个设备首次相互连接时才会出现该对话框.顺便说一句…修改WifiP2pConfig的WpsInfo是没有用的.它将始终使用“按钮配置”选项.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值