wifip2p

Wi-fi P2P. Inform all peers available of some event

放肆的年华 提交于 2019-12-30 03:31:11
问题 The problem: I'm making an offline-multiplayer android game, where people can create or join a room and play together via Wi-fi. Consider the situation when a user creates a room and he (of course) has to inform all other users that there is a room available. So the question is "How?".I've read about 1000 times this and this. It's written there that in order to send some data to another device, one of them should be a server and the other one a client. Client sends some info to the server,

Can I use Wi-Fi Direct and cellular data in an app?

偶尔善良 提交于 2019-12-29 04:57:07
问题 I have two+ Android devices. I would like the devices to send instructions to the other devices using Wi-Fi Direct, while at the same time being able to access the internet via their cellular data connection. It seems that using the Wi-Fi Direct interface is being treated as the primary connection, disabling the other connections, just like how Wi-Fi disables the cellular data connection. How can I programmatically allow both to operate at the same time? Currently the Wi-Fi Direct receiver is

How to get the deviceName of my device using wifi p2p

只谈情不闲聊 提交于 2019-12-25 06:44:57
问题 I'm developing an app based on Google's wifi p2p API and I would like to get the name of the device I'm using (not the peers) but the only way I found to retrieve the name is in case I change it by using something like this: if (WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION.equals(action)) { // this device details has changed(name, connected, etc) mApp.mThisDevice = (WifiP2pDevice) intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_DEVICE); mApp.mDeviceName = mApp.mThisDevice

How to find devices via Wi-fi peer 2 peer, that have the same app installed?

倖福魔咒の 提交于 2019-12-23 04:24:10
问题 I am quite new in the Android development. I have an app that tries to connect to other devices running android via Wi-Fi peer 2 peer. What I want to do is to see only the devices that have the same app installed rather than see all the available peers. Thanks in advance. 回答1: Yeah you can do this!! :) Try using the Wifi P2p for Service Discovery. Actually, the link is a training which teaches exactly what you want. So, what you basically want to do is create a WifiP2pDnsSdServiceInfo object

WiFi P2P network in Android Things

独自空忆成欢 提交于 2019-12-22 08:15:54
问题 I would like to create a P2P WiFi network using Android Things (5.1) and a couple of Raspberry Pi 3 or alternatively using Bluetooth. I followed the guide in the Android Developer section https://developer.android.com/guide/topics/connectivity/wifip2p.html, so my MainActivity looks like: private class MainActtivity { private WifiP2pManager mManager; .... @Override public void onCreate(Bundle savedInstances) { mManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE); .... } }

WiFi P2P network in Android Things

耗尽温柔 提交于 2019-12-22 08:15:04
问题 I would like to create a P2P WiFi network using Android Things (5.1) and a couple of Raspberry Pi 3 or alternatively using Bluetooth. I followed the guide in the Android Developer section https://developer.android.com/guide/topics/connectivity/wifip2p.html, so my MainActivity looks like: private class MainActtivity { private WifiP2pManager mManager; .... @Override public void onCreate(Bundle savedInstances) { mManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE); .... } }

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

爷,独闯天下 提交于 2019-12-19 09:50:32
问题 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

Why is discovering peers for Android Wi-Fi Direct so unreliable?

怎甘沉沦 提交于 2019-12-18 11:14:05
问题 I am experimenting with Android's Wi-Fi Direct (or P2P if you prefer). I thought it was working very nicely between my two phones, but I realized I am encountering issues with the WifiP2pManager.discoverPeers() and/or WifiP2pManager.requestPeers() . I have observed these results: No peers are discovered and no callbacks are fired for a good 1+ minute. I observe this through the Wi-Fi Direct portion of the Android Wi-Fi settings as well. This is odd because sometimes the discovery completes

Wifi P2P service discovery works intermittently

人盡茶涼 提交于 2019-12-17 21:42:15
问题 Wifi P2P service discovery is not behaving as expected. I am seeing intermittent issues where the DNSSD listeners are not called always and hence I have no clue of nearby devices running the same app. I am using the following two APIs - one to register a service to be discovered by other devices and the other to discover the nearby services running on other devices. Any idea if I am doing anything wrong here or is there some specific sequence of other android API calls that need to be made

How to auto-accept Wi-Fi Direct connection requests in Android

不问归期 提交于 2019-12-17 17:54:25
问题 I have 2 Android devices using WiFi Direct. On one device I can get information about the other device using the WifiP2pManager class, and request a connection to the other device. However when I request a connection, the other device pops up a little window and asks the user if they want to accept the connection request. Is it possible to auto-accept these connection requests? I.E to be able to connect to the other device without user confirmation? 回答1: Based on the comments, do you really