连接到移动热点的用户的详细信息 [英] Details of connected users to mobile hotspot
问题描述
如果我在自己的Android手机中启用了Wi-Fi热点,并且其他2部android手机已连接到我的Hotspot,那么如何区分每部手机?
If I've enabled Wi-Fi Hotspot in my android phone and 2 other android phones are connected to my Hotspot, then how can I distinguish between each phone?
我的手机会使用IEMI号码还是其他名称来区分不同的手机?
Does my phone distinguish between the different phones using IEMI numbers or something else?
推荐答案
1)您可以使用BroadcastReciever"android.net.wifi.WIFI_HOTSPOT_CLIENTS_CHANGED"来检测客户端连接. 在您的AndroidManifest中:
1) You can use BroadcastReciever "android.net.wifi.WIFI_HOTSPOT_CLIENTS_CHANGED" to detect client connection. In your AndroidManifest:
<receiver
android:name=".WiFiConnectionReciever"
android:enabled="true"
android:exported="true" >
<intent-filter>
<action android:name="android.net.wifi.WIFI_HOTSPOT_CLIENTS_CHANGED" />
</intent-filter>
</receiver>
以及您的活动:
IntentFilter mIntentFilter = new IntentFilter();
mIntentFilter.addAction("android.net.wifi.WIFI_HOTSPOT_CLIENTS_CHANGED");
rcv = new WiFiConnectionReciever();
registerReceiver(rcv,
mIntentFilter);
2)另一方面,也请检查以下答案: https://stackoverflow.com/a/21545389/1384010
2) On other hand please check this answer too: https://stackoverflow.com/a/21545389/1384010
希望以上方法之一将对您有帮助!
Hope one of above methods will help you !!
这篇关于连接到移动热点的用户的详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!