本文介绍了Android wifi热点客户端连接事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过android应用程序以编程方式将不同的设备与wifi热点AP连接,如何检测以编程方式打开和关闭的客户端以及已连接到wifi热点AP的客户端? Android API中是否有任何回调事件可提供有关单个设备的连接或断开连接事件的信息?提前致谢.

I am connecting different devices with wifi hotspot AP programatically in my android app, How can i detect the clients being connected and disconnected and to the wifi hotspot AP i turned on programmatically ? Is there any callback event in Android API to give information regarding the connection or disconnection events of individual devices ?Thanks in advance.

推荐答案

我认为您需要使用WifiP2pDevice您可以在此处检查可用的设备,以及它们是否已连接.

I think you need to use WifiP2pDeviceThere you can check for available devices, and also if they are connected or not.

尝试在此处此处查看可用方法

Try looking here at the available methods here

编辑 :

EDIT:

Android Wifi热点管理器类具有示例代码扫描/proc/net/arp并ping每个已知的客户端以检测生计.

This Android Wifi Hotspot Manager Class have sample code to scan /proc/net/arp and ping each known client to detect livelihood.

您可以在循环中实现该逻辑,以模拟驱动程序中的Wifi客户端断开连接事件.

You can implement that logic in a loop to emulate a Wifi Client disconnect event from driver.

这篇关于Android wifi热点客户端连接事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 00:31