移动云

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
移动云 门户 移动应用开发 Android开发 查看内容

关于Android4.0(ICS)新增的WIFI-DIRECT

2012-9-18 16:47| 发布者: admin| 查看: 18052| 评论: 0|原作者: freesky

摘要: 下面是摘自AndroidSDK官方文档(http://developer.android.com/guide/topics/wireless/wifip2p.html) Wi-Fi Direct allows Android 4.0 (API level 14) or later devices with the appropriate hardware to connect ...
下面是摘自AndroidSDK官方文档(http://developer.android.com/guide/topics/wireless/wifip2p.html)
Wi-Fi Direct allows Android 4.0 (API level 14) or later devices with the appropriate hardware to connect directly to each other via Wi-Fi without an intermediate access point. Using these APIs, you can discover and connect to other devices when each device supports Wi-Fi Direct, then communicate over a speedy connection across distances much longer than a Bluetooth connection. This is useful for applications that share data among users, such as a multiplayer game or a photo sharing application.

The Wi-Fi Direct APIs consist of the following main parts:
•Methods that allow you to discover, request, and connect to peers are defined in the WifiP2pManager class.
•Listeners that allow you to be notified of the success or failure of WifiP2pManager method calls. When calling WifiP2pManager methods, each method can receive a specific listener passed in as a parameter.
•Intents that notify you of specific events detected by the Wi-Fi Direct framework, such as a dropped connection or a newly discovered peer.

You often use these three main components of the APIs together. For example, you can provide a WifiP2pManager.ActionListener to a call to discoverPeers(), so that you can be notified with the ActionListener.onSuccess() and ActionListener.onFailure() methods. A WIFI_P2P_PEERS_CHANGED_ACTION intent is also broadcast if the discoverPeers() method discovers that the peers list has changed.
------------------------------------------------------------分隔线-------------------------------------------------------
结构应该是这个样子的
wd.png

感兴趣的童鞋可以去研究研究

鲜花

握手

雷人

路过

鸡蛋

相关分类

小黑屋|管理员QQ:44994224|邮箱(t268studio@gmail.com)|Archiver|MCLOUDER

GMT+8, 2024-5-5 00:06 , Processed in 0.031090 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

返回顶部