I am trying to create a WiFi Direct Group with a custom name. But after exploring all the options I came to know that we cannot change the name and Android OS decide itself about the name of WiFi Direct Group
I even tried Reflection to achieve the same but it didn't worked on Android Nougat and above.
I am using the following code to create the WiFi Direct Group:
WifiP2pManager manager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE);
WifiP2pManager.Channel channel = manager.initialize(this, getMainLooper(), null);
manager.createGroup(channel, new WifiP2pManager.ActionListener() {
@Override
public void onSuccess() {
Toast.makeText(getApplicationContext(), "Group Created", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(int i) {
Toast.makeText(getApplicationContext(), "Group Creation Failed", Toast.LENGTH_SHORT).show();
}
});
But when I tried PDANet+ app they were able to create a WiFi Direct Group Name with a suffix PDANet.
For example:
My app generates the following Group name : DIRECT-mq-ONEPLUS
While PDANet generates: DIRECT-Dj-ONEPLUS A6000-PdaNet
So I was wondering how they are adding the Suffix to the WiFi Direct Group name. If anyone can help me on this that will be much help.!
Thanks.!
from Add Suffix to name of WiFi Direct Group name. (similar to what PDANet does)
No comments:
Post a Comment