"Android" Android-wifi direct Wi-Fi direct WiFi peer

Source: Internet
Author: User

Now, Android's Wi-Fi-enabled direct point-to-point (peer-to) Android system is powered by devices and other types of devices that do not have a connection between a hotspot or an Internet connection. Android Framework provides a set of Wi-Fi peer APIs that allow you to discover and connect to other devices when each device's Wi-Fi direct support, and then communicate across distances far longer than Bluetooth connectivity quickly?? Connection.

ANDROID.NET.WIFI.P2P, a new package that contains all the APIs to perform peers such as connecting with Wi-Fi. You need to be wifip2pmanager with the main class, you can call Getsystemservice (wifi_p2p_service) acquisition. Wifip2pmanager includes APIs that allow you to:

1. You connect to the application by calling initialize

2. Explore by calling nearby devices Discoverpeers

It is necessary to start by calling peer to connect and some other interfaces and classes, such as:

The Wifip2pmanager.actionlistener interface allows you to receive operations such as discovering peers or connecting to their successful or failed callbacks.

The Wifip2pmanager.peerlistlistener interface allows you to receive information about your discovery peers. Callbacks provide a wifip2pdevicelist from which you can retrieve a wifip2pdevice range of each device object and get information such as the name of the device, address, device type, and the WPS configuration supported by the device.

Wifip2pmanager.groupinfolistener interface, you can receive one-to-peer group information. The callback provides a Wifip2pgroup object that provides information about the owner, network name, and password, such as a group.

Wifip2pmanager.connectioninfolistener interface, you can get information about the current connection. Callbacks provide a Wifip2pinfo object that has information such as whether a group has been formed and who is the owner of that group.

In order to use the Wi-Fi peer API, your application must require the following user rights:

1, Access_wifi_state

2, Change_wifi_state

3. Internet (although your application is not technically connected to the Internet, communicating Wi-Fi standard Java sockets directly requires INTERNET access).

The Android system also broadcasts several different actions in a specific Wi-Fi peer event:

1, wifi_p2p_connection_changed_action:p2p connection status has changed. This is the object with Extra_wifi_p2p_infowifip2pinfo and Extra_network_infonetworkinfo objects Extra_network_infoextra_network_infoextra_ Wifi_p2p_info Extra_wifi_p2p_info.

2. The status of WIFI_P2P_STATE_CHANGED_ACTION:P2P has been changed between enabled and disabled. It carries extra_wifi_state either wifi_p2p_state_disabled or wifi_p2p_state_enabled

The list of devices such as wifi_p2p_peers_changed_action has changed.

3, Wifi_p2p_this_device_changed_action: The details of the device have been changed.

See the Wifip2pmanager documentation for more information. Also look for a direct Demo sample application on Wi-Fi.

Http://developer.android.com/reference/android/net/wifi/p2p/package-summary.html

What is the difference between Wi-Fi direct and Ad-hoc mode?
Wi-Fi Direct will provide a powerful discovery feature that makes it easier to use. Wi-Fi Direct combines a number of key innovations in Wi-Fi technology, such as higher data rates, enterprise management capabilities, and WMM. Quality of service mode, and the Power Management protocol for Point-to-point connections.

Http://wifinetnews.com/archives/2009/10/wifi_direct_peering.html

The two are different in security, Wi-Fi Direct is encrypted with WPA2 (Wi-Fi Protection Access Version 2), and the highest security support is WEP under the Windows Ad-hoc network. However, Windows 7 also supports WPA2.

Digitimes Chinese web site: Wi-Fi Direct 10 quiz http://gb-www.digitimes.com.tw/tw/dt/n/shwnws.asp?id=0000205310_ A224ie390epo7s191b4cm#ixzz1idk5ewpn

The two are different in security, Wi-Fi Direct is encrypted with WPA2 (Wi-Fi Protection Access Version 2), and the highest security support is WEP under the Windows Ad-hoc network. However, Windows 7 also supports WPA2

"Android" Android-wifi direct Wi-Fi direct WiFi peer

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.