Skip to content Skip to sidebar Skip to footer

How To Get The Devicename Of My Device Using Wifi P2p

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 ca

Solution 1:

If Wi-Fi is enabled and you register P2P and everything on load, then the device name should be available right away when that intent fires. If Wi-Fi is disabled, then you would have to wait for it to be enabled if you want to get the device name from WifiP2pManager. That's the only way I know how to get the name.

Solution 2:

The only way I see, is using reflection to change the device name and then using your code to get the original device name, after that you can set the device name back to the original.

Post a Comment for "How To Get The Devicename Of My Device Using Wifi P2p"