android wifi-director api 解读

 

1、When a p2p connection is formed over wifi, the device continues to maintain the uplink connection over mobile or any other available network for internet connectivity on the device.

 

翻译:上边的意思是,当p2p通过wifi工作的时候,3g网络的上行和你的wifi网络该干嘛干嘛,没什么影响。不要一位p2p占用了wifi其他都得让路,wifi-director还是很强大的。

 

2、The API is asynchronous and responses to requests from an application are on listener callbacks provided by the application. 

 

翻译:p2p的api都是异步的,不要幻想你调用了某个功能立马就能生效,他会先立即返回,你调用的功能是否成功通过callback返回给你。

 

3、 For communication with legacy Wi-Fi devices that do not support p2p, an app can create a group usingcreateGroup(WifiP2pManager.Channel, WifiP2pManager.ActionListener) which creates an access point whose details can be fetched withrequestGroupInfo(WifiP2pManager.Channel, WifiP2pManager.GroupInfoListener).

 

翻译:这个比较麻烦,搞的还不是很清楚,暂时理解成:如果设备比较老,不支持p2p,但他还是可以调用createGroup接口来启动一个热点,这个热点信息可以通过函数requestGroupInfo抓取到。

 

4、An application can advertise a Upnp or a Bonjour service with a call to addLocalService(WifiP2pManager.Channel, WifiP2pServiceInfo, WifiP2pManager.ActionListener). After a local service is added, the framework automatically responds to a peer application discovering the service prior to establishing a p2p connection. A call to removeLocalService(WifiP2pManager.Channel, WifiP2pServiceInfo, WifiP2pManager.ActionListener) removes a local service and clearLocalServices(WifiP2pManager.Channel, WifiP2pManager.ActionListener) can be used to clear all local services.

 

翻译:我们可以添加一个即插即用的服务服务被添加后,framework曾可以自动优先响应服务请求。

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值