问题描述
我有这个帖子的类似问题
但是,似乎没有从该帖子中获得任何解决方案。
I have the similar question with this postAndroid WiFi Direct device detailsHowever, it seem din't get any solution from that post.
是否有任何方法可以用于设置与bluetoohAdapter和amp的功能类似的setName()或setServiceName的wifi直接名称。 NsdServiceInfo。
Is it any method can used to set the wifi-direct name that similar with function of "setName()" or "setServiceName" in bluetoohAdapter & NsdServiceInfo.
推荐答案
您可以使用反射重命名设备WiFi直接名称。检查解决方案:
You can rename the device WiFi Direct name using reflection. Check the solution here: Android rename device's name for wifi-direct
另外,在/data/misc/wifi/p2p_supplicant.conf中还有一个名为p2p_supplicant.conf的文件,其中包含指定了WiFi Direct名称的字段。您可以使用我的答案稍微调整编辑它:
Additionally, there is a file called p2p_supplicant.conf in the /data/misc/wifi/p2p_supplicant.conf that contains a field where the WiFi Direct name is specified. You can edit it using my answer on with a slight adjustment: editing a value in the file p2p_supplicant.conf which is located on /root/data/misc/wifi/p2p_supplicant.conf
只需要注意,您可以手动更改手机上的WiFi Direct设备的名称,而无需应用程序。在Android手机上的WiFi-> Wifi Direct中有一个重命名设备选项。
Just a note that you can manually change the name of the WiFi Direct device on the phone without the need for an App. There is a rename device option in WiFi->Wifi Direct on Android phones.
希望这有帮助。如果您有任何问题,请告知我。
Hope this helps. Let me know if you have any questions.
这篇关于如何设置WiFi的接口设备名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!