Post navigation

64 thoughts on “Android Wifi Hotspot Manager Class”

Hi Nick, First of all thank you for this information it helped a lot ! i have couple of questions though.. 1) The code works fine for Android devices and Linux operating system laptops but it can not get information of the users of Windows phone and windows 7/8/10 operating system in laptops. These windows phone and windows 7/8/10 operating system users are connected to my phone but the application can not detect them.. Is it because windows holds some other path of ARP table other than “/proc/net/arp” or something ? 2) I am getting Name of the device whenever mobile data is off and only hotspot in on. but when i switch on the mobile data i get only IP Address instead of name. why so ? 3) What if i want to remove a particular user from the connection. is it possible ?

hi nick!!! your code works great…but i m not getting the list of connected devices. Plus the app does not work and throws null pointer exception in main.java on Line textView1.setText(“WifiApState: ” + wifiApManager.getWifiApState() + “\n\n”); and in wifiApmanger on line finishListener.onFinishScan(result); untill n unless i do it with try and catch block plzz help!!

Hi Nick. First of all, thanks a ton for this wonderful example. It worked perfectly. I wanted to know whether can i get notified if any client gets connected to the hotspot. I want this to happen in the background when the app is not running. Any help to achieve this will be highly appreciated. Thanks

I try change SSID and password but not successful. I created new instance belong WifiConfiguration, pre-set BSSID and preShareKey, and pass it to setWifiApEnabled() method. The app run without cashing but I just get the null SSID and without any security. Could you share the full configuration for WifiConfiguration instance before pass it to setWifiApEnabled() method.

I tried successfully with change SSID, I assigned SSID instead of BSSID and next I stuck with security, it always open without any security method. Could you guide me which parameters in WifiConfigurtion class I should change to enable security for hotspot?

Hi there i have implemented this into my application which runs perfectly, however after i updated to Lolipop there seems to be an issue with turning on the Access Point. I was wandering what could be the issue?

This is the code that i have used, ignore the issue that i have asked on stack overflow i have fixed that problem now. However as mentioned before when i install the apk everything works fine however when i click the get clients button nothing seems to happen. If you would like i can give you the APK file for you to take a look?

Hi, Nick I have more question. When I get a list of clients connected, client’s reachable value always ‘false’. And client is disconnected but list contain it’s info. I think it can’t be helped because arp is not refresh.. Then, can I know connected client’s name (ex. Choi’s PC)? Please advice would be appreciated.

Hi, Nick. Thanks for great library! I have one question. How can I detect client’s connection to my hotspot (after turns on the hotspot) like status bar-push message (ex.”1 device connected”) I wanna do something by programmatically when client connect hotspot. If you know about it, help me please.

Hello i absolutely love what you have done here. Im not to sure on the regulations on the re usability of code, however would be possible if i can use this code for my dissertation project? im sorry if this is a silly question because in all i really wouldnt want to use this without your consent

Sorry about my last post, i wrote it on my cell phone and didnt checked it after writing. Im trying to open a hotspot with hiddenSSID set to true, but i can see it from all devices. Is the atribute deprecated? I have to set something else?

when I disconnect client, the example can’t update the clients list in the view. And I restart the app, it can’t know the client has been disconnected either, how to know client was disconnected dynamitially?

I want to define a connection to my access point. I want receive notifications when users connected. I know that I can query arp table(/proc/net/arp) , from which I can find connected users. Is there any better way to do this, except viewing arp-table every n seconds?

Hi, first of all thank you it’s very useful! But, do you know which broadcast intent is necessary for broadcast receivers which should listen on changes made on the device’s AP (enabling, disabling,…) ?

Hi Nick, great job. Do you know if it is possible to change the channel also? By default is 6, but I want to change it. I was looking in the source and I discover one field which could be suitable for that but I didn’t get anything (no change, no error) I’m doing this: WifiConfiguration netConfig = new WifiConfiguration(); netConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK); … Field wcAdhocFreq = WifiConfiguration.class.getField(“frequency”); wcAdhocFreq.setAccessible(true); wcAdhocFreq.setInt(netConfig, 2462); //2462 = center freq of channel 11 … mWifiApManager.setWifiApEnabled(netConfig, true);

Hey, I found this by Google and I must say it’s so helpful, thank you for sharing 🙂 I’ve literally just plugged this into my app (made your example app a library in eclipse) and it works like an ace, but I’m wondering if it’s possible to get the IP address of the hotspot? Can I get that from the WifiManager object? Also, do you have any specific license you want to put this under or is it free?