wifi-direct

Check whether android wifip2p connection was successful?

旧时模样 提交于 2019-12-01 21:44:53
问题 I am connecting two android devices via Wifi Direct. I created a group using Wifip2pManager.createGroup on the first device. Now, on the second device I call the Wifip2pManager.connect method. But the connect method is succesful, even if the first device declines the connection since it only checks for successful initialization . How do I check if the other device accepted the connection ? 回答1: The class needs to implement ConnectionInfoListener. And in the function onConnectionInfoAvailable

Wifi Direct Groups Memorised

陌路散爱 提交于 2019-12-01 21:36:15
How can I delete the groups memorised by Wifi Direct? If it is possible, what is the function allowing to delete groups? thanks. Wi-Fi Direct Persistent groups are not implemented yet as far as I know (in Android API level 17). So you don't have to bother deleting memorised groups as they don't exists (yet). The only way is to delete groups with introspection: Method deletePersistentGroupMethod = WifiP2pManager.class.getMethod("deletePersistentGroup", WifiP2pManager.Channel.class, int.class, WifiP2pManager.ActionListener.class); for (int netid = 0; netid < 32; netid++) {

WiFi Direct device connection with other Android devices

扶醉桌前 提交于 2019-12-01 13:39:09
Can I connect a WiFi Direct enabled device to any other device which doesn't have WiFi Direct feature but supports WiFi hotspot connection? Does WiFi direct uses specialized hardware to be present on both devices? Will network discovery work in such cases? It is possible. Code taken from a talk I gave at Droidcon UK 2013. You need to call the createGroup(WifiP2pManager.Channel c, WifiP2pManager.ActionListener listener) method of the WifiP2pManager class. This will create a Wi-Fi Direct group that supports legacy Wi-Fi connections. Prior to the call, you need to register a broadcast receiver

WiFi Direct status

怎甘沉沦 提交于 2019-12-01 13:06:55
问题 Is it possible to specifically check that whether WiFi Direct is On or Off ? I wrote a code which can only update about the wifi status that whether it is connected or not,no matter it is Access point or WiFi Direct ConnectivityManager connManager = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (mWifi.isConnected()) { } if (!mWifi.isConnected()) { } I want to specifically

Android P2P service discovery callbacks not being called

荒凉一梦 提交于 2019-12-01 11:14:43
I'm fairly new to Android and I'm working on an application that will exchange data over WIFI direct and I would like to use DNS Service Discovery instead of pure P2P discovery to get more useful information like device "nick names" etc. So far I've followed the tutorials at http://developer.android.com/training/connect-devices-wirelessly/index.html and read through the documentation. My application seems to register it's local service successfully and the onSuccess callback from discoverServices is always called, however the txtServiceRecord from other devices (I'm using 2 devices) is never

How do you retrieve the WiFi Direct MAC address?

一个人想着一个人 提交于 2019-12-01 09:52:37
I am trying to retrieve the MAC address of an Android device. This is ordinarily possible through the WiFiManager API if WiFi is on. Is there any way to get the MAC address if WiFi is off and WiFi Direct is on? WiFi AND WiFi Direct can't be on at same time on my phone. Thanks I had been searching for this during my project. My requirements were to uniquely identify devices in an adhoc P2p network formed with WiFi Direct. Each device should identify its friend device the next time when it comes into proximity. I needed my own WiFi (Direct) MAC and my friends' to create a Key for this friend

Alternative to discovering peers with Wifi Direct as it requires both phones running WiFi Direct discovery

廉价感情. 提交于 2019-12-01 09:21:22
I am trying to discover WiFi Direct peer to peer android devices but peers are discovered only when both phones are running WiFi Direct discovery. What I have Understood so far is, they will see each other only when they are both scanning for WiFi direct connections at the same time. This is because the way WiFi Direct works is that when phones are scanning for WiFi Direct connections, they will negotiate with the other peers for the role of Access Point or Slave device. Hence both need to call discoverPeers() to become discoverable themselves and find nearby devices. What I want in my

Sending data in Android WiFi Direct service discovery instead of connecting

点点圈 提交于 2019-12-01 08:45:27
Following the documentation here: http://developer.android.com/training/connect-devices-wirelessly/nsd-wifi-direct.html It appears to be possible to broadcast data to all nearby devices that have WiFi Direct without establishing a connection by just putting the data in a WifiP2pDnsSdServiceInfo object. This works for my purposes as I'm attempting to establish a simple P2P messaging app amongst multiple nearby devices. However it seems like a misuse of the API as this is intended to carry information to setup a connection and advertise a service. My questions are: What are the pros and cons of

WiFi Direct for multiple devices

若如初见. 提交于 2019-12-01 08:44:34
I am trying to establish file transfer (between 3 devices) through Wifi Direct from the tutorial given in http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html This has explained how to manage connections between 2 devices. After going through some posts on stackoverflow, this post - WiFi Direct (Android 4.0) with multiple (3+) devices has explained how to connect 3 devices in a manner where A->B and C->B, where I've considered B as my Group Owner. I wanted to know if there is any way in which I can transfer a file in a manner where B->A and B->C simultaneously.

WiFi Direct for multiple devices

与世无争的帅哥 提交于 2019-12-01 07:52:41
问题 I am trying to establish file transfer (between 3 devices) through Wifi Direct from the tutorial given in http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html This has explained how to manage connections between 2 devices. After going through some posts on stackoverflow, this post - WiFi Direct (Android 4.0) with multiple (3+) devices has explained how to connect 3 devices in a manner where A->B and C->B, where I've considered B as my Group Owner. I wanted to know