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.deviceName;
PTPLog.d(TAG, "processIntent: WIFI_P2P_THIS_DEVICE_CHANGED_ACTION " + mApp.mThisDevice.deviceName);
if( mApp.mHomeActivity != null ){
mApp.mHomeActivity.updateThisDevice(mApp.mThisDevice);
}
}
But I don't want that (to wait until a change), I want to know my own name from the beginning, in order to show it when I just open the app. Is this possible?