Tag: wifip2p

Wi-Fi Direct and “normal” Wi-Fi – Different MAC?

I’m currently trying to connect two phones which know each other’s MAC address via Wi-Fi Direct, and stumbled upon the following problem: The MAC address, which I receive from WifiManager wifiMan = (WifiManager) this .getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInf = wifiMan.getConnectionInfo(); MAC_ADDRESS = wifiInf.getMacAddress(); is slightly different than the one I receive from the WifiP2pManager when discovering […]

Is multicasting possible with Wi-Fi Direct?

I’m a bit confused about the new Wi-Fi Direct feature in Android ICS. Is it possible to create a P2P group with multiple devices, and send multicast packets from a source peer to the other peers? Unfortunately, I don’t have any devices that are Wi-Fi Direct enabled, so I can only browse the examples that […]

WiFiDirect discoverServices keeps failing with error 3 (NO_SERVICE_REQUESTS)

I’m using WiFi P2P for network service discovery, and I’m following the instructions as outlined on the developer guide. Here’s the relevant code in my service class: public void onCreate() { manager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE); channel = manager.initialize(this, getMainLooper(), null); registerP2pService(); lookForServices(); } private void registerP2pService() { WifiP2pDnsSdServiceInfo serviceInfo = WifiP2pDnsSdServiceInfo.newInstance(“_service.name”, “_presence._tcp”, new HashMap<String, String>()); […]

How change the device name in WiFi direct p2p?

Is it possibile to change the device name of WiFi direct through the code? I’ve tried to: private WifiP2pDevice wDevice; wDevice.deviceName = “newName”; But, obviously it doesn’t work. Any idea?!

How do i get a Peer-to-peer WiFi service discovery to work?

I’m trying to build a server-client architecture using two Android devices with a peer-to-peer WiFi connection. I’ve got a clear distinction between client and server, so I’m trying to prune out unnecessary code. Using directions from http://developer.android.com/training/connect-devices-wirelessly/nsd-wifi-direct.html I’ve got… PeerToPeerService public class PeerToPeerService { private static final Logger LOG = LoggerFactory.getLogger(PeerToPeerService.class); private WifiP2pManager mManager; private […]

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

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 […]

How to be notified when a peer is no longer available in the Wi-Fi Direct range?

I am developing an Android application based on the use of Wifi Direct API. I have registered in my Activity a BroadcastReceiver in order to be notified about the following Wifi Direct events: WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION, WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION, WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION and WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION. I believed that any change in the list of peers (the inclusion or exclusion of a peer […]

Wifi-Direct always disconnects after thirty minutes

I am creating a WifiP2pGroup with WifiP2pManager.connect(). This works fine but the group is always disbanded after thirty minutes, no matter whether data is being transferred or not. Does anyone know why this happens, or if it can be prevented? I have tried sending data continuously between the devices and keeping the screens on the […]

Wifi P2P service discovery works intermittently

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 […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.