nickrussler / android-wifi-hotspot-manager-class Goto Github PK
View Code? Open in Web Editor NEWAndroid Wifi Hotspot Manager Class
License: Apache License 2.0
Android Wifi Hotspot Manager Class
License: Apache License 2.0
See #11 (comment)
Hi,
How can I get the security type(capability) of already created hotspot?
I am using mWifiHelper.getWifiApConfiguration().priority; to get it, but it gives me 0 only no matter its set as WPA,WPA2 or Open.
Can please tell me what I am doing wrong?
I want achieve modify wifi mac address,how to do it. thanks
Hey,
I am trying to create an start an WPA2 Hotspot. I managed to start the Hotspot with the right SSID but WPA2 wont work... I think the problem is the WifiConfiguration, but I can't figure it out.
`
WifiConfiguration wfc = new WifiConfiguration();
wfc.SSID = "\"" + ssid + "\"";
wfc.preSharedKey = "\"" + pw + "\"";
wfc.status = WifiConfiguration.Status.ENABLED;
wfc.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
wfc.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
wfc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
wfc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
wfc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
wfc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);
wfc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104);
wfc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
wfc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
wifiApManager.setWifiApEnabled(wfc, true);
`
Can you help me?
I'm totally new to Android programming but I try to gather parts required to implement my idea so I'd like to know if the hotspot management is possible on a non-rooted device.
Please add this into the docs. Thanks!
I'm wondering if WRITE_SETTINGS
permission is compulsory to toggle the hotspot? I can't find it anywhere in the WifiManger class or setWifiEnabled method's prerequisites.
CHANGE_NETWORK_STATE
is what's written in the setWifiEnabled method as a prereq.
Very useful library thanks for it !
However I want to create a app which will display the list of all the devices which are within range of wifi hotspot, it may be connected or not. I simply want all the devices within the range of wifi hotspot.
Is this library capable of doing it? If yes how can i achieve it?
Can we detect the internet usages by connected client of wifi hotspot?
Hi Nick,
It appears that the methods used and all methods I have attempted to use when creating a hotspot result in an IP Configuration failure on the remote device.
This applies to your code and multiple other examples across the web, have you experienced this or come across a solution?
dear nick,
i had try to get device name information from device that connected to my hotspot, but i cant get it, do you know how to get device name information?
thanks
I've tried your example and noticed that Android seems to automatically disconnect from the current WiFi when the hotspot is activated. Would it be better to store the previous WiFi connection settings and reconnect when the AP gets disabled (or give an API for that in the hotspot manager)?
Hi Droid,
I tried it is working fine in below Android5.0 versions. But when i tried to run it in the Android 5.0 and above it is not switching the device from Wifi to Hotspot.
Thanks
Harish
Excuse me , when I test from android 5.0.2 (sony z1 )
When I enable hotspot , if 3g is disabled, it will show a Tethering error dialog, and crash the app.
Have you take this state?
Thank you.
Hi Nick,
The library works great but when I set a configuration for a WPA_PSK hotspot, the hotspot is created but it can't be connected on the other device.
Of course this is not your code's problem since I'v been dealing with this with any other solution. it is like the hotspot is created with a problem!
any ideas how to solve this problem?
PS: I'm making hotspot on android 7.1 and the client is running 5.1. and this only happens when I create hotspot on android 7+ devices.
Hello,
I have working in wifi hostpot and i have test a this demo and i have some bug so please suggest me for this bug,
WifiApManager$1: java.net.SocketException: socket failed: EACCES (Permission denied)
this bug get in scan wifi hostpot in main.java
Please suggest me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.