-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58826f9
commit 3df4638
Showing
1 changed file
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# WiFiManager | ||
Util library used as a wrapper around WiFi and Connectivity manager for Android | ||
|
||
> <br/>*Developed by Patches 04/24/2016 - present* <br/><br/> | ||
## Commands | ||
|
||
To add a WEP network: | ||
|
||
```java | ||
WiseFy.getSmarts().addWEPNetwork(getActivity(), "WEP Network", "123456") | ||
``` | ||
|
||
To add a WPA2 network: | ||
|
||
```java | ||
WiseFy.getSmarts().addWPA2Network(getActivity(), "WPA2 Network", "12345678") | ||
``` | ||
|
||
To add an open network: | ||
|
||
```java | ||
WiseFy.getSmarts().addOpenNetwork(getActivity(), "Open Network") | ||
``` | ||
|
||
To calculate number of bars given a networks signal strength and total number of bars: | ||
|
||
```java | ||
int bars = WiseFy.getSmarts().calculateBars(-35, -5) | ||
``` | ||
|
||
To compare the signal strength of two networks: | ||
|
||
```java | ||
int result = WiseFy.getSmarts().compareSignalLevel(-35, -70) | ||
``` | ||
|
||
To disable wifi: | ||
|
||
```java | ||
WiseFy.getSmarts().disableWiFi(getActivity()) | ||
``` | ||
|
||
To disconnect from current network: | ||
|
||
```java | ||
WiseFy.getSmarts().disconnectFromCurrentNetwork(getActivity()) | ||
``` | ||
|
||
To enable wifi: | ||
|
||
```java | ||
WiseFy.getSmarts().enableWiFi(getActivity()) | ||
``` | ||
|
||
To get current network: | ||
|
||
```java | ||
WifiInfo wifiInfo = WiseFy.getSmarts().getCurrentNetwork(getActivity()) | ||
``` | ||
|
||
To get nearby access points:<br/><br/> | ||
<strong>Setting filterDuplicates to true will not return SSIDs with a weaker signal strength (will always take the highest)</strong> | ||
|
||
```java | ||
List<ScanResult> scanResults = WiseFy.getSmarts().getNearbyAccessPoints(getActivity(), true) | ||
``` | ||
|
||
To get the networks whose configuration is already stored: | ||
|
||
```java | ||
List<WifiConfiguration> savedNetworks = WiseFy.getSmarts().getSavedNetworks(getActivity()); | ||
``` | ||
|
||
To reconnect to a network given an SSID: | ||
|
||
```java | ||
boolean reasul = WiseFy.getSmarts().reconnectToNetwork(getActivity(), "SSID To Reconnect To", 30); | ||
``` | ||
|
||
To remove a configured network: | ||
|
||
```java | ||
boolean reasul = WiseFy.getSmarts().removeNetwork(getActivity(), "SSID To Remove"); | ||
``` | ||
|
||
To search for an SSID given a search string: | ||
|
||
```java | ||
String ssid = WiseFy.getSmarts().searchForSSID(getActivity(), "SSID To Search For", 30); | ||
``` |