Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix README #3

Merged
merged 1 commit into from
Apr 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,62 @@ Util library used as a wrapper around WiFi and Connectivity manager for Android
To add a WEP network:

```java
WiseFy.getSmarts().addWEPNetwork(getActivity(), "WEP Network", "123456")
WiseFy.getSmarts().addWEPNetwork(getActivity(), "WEP Network", "123456");
```

To add a WPA2 network:

```java
WiseFy.getSmarts().addWPA2Network(getActivity(), "WPA2 Network", "12345678")
WiseFy.getSmarts().addWPA2Network(getActivity(), "WPA2 Network", "12345678");
```

To add an open network:

```java
WiseFy.getSmarts().addOpenNetwork(getActivity(), "Open Network")
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)
int bars = WiseFy.getSmarts().calculateBars(-35, -5);
```

To compare the signal strength of two networks:

```java
int result = WiseFy.getSmarts().compareSignalLevel(-35, -70)
int result = WiseFy.getSmarts().compareSignalLevel(-35, -70);
```

To disable wifi:

```java
WiseFy.getSmarts().disableWiFi(getActivity())
WiseFy.getSmarts().disableWiFi(getActivity());
```

To disconnect from current network:

```java
WiseFy.getSmarts().disconnectFromCurrentNetwork(getActivity())
WiseFy.getSmarts().disconnectFromCurrentNetwork(getActivity());
```

To enable wifi:

```java
WiseFy.getSmarts().enableWiFi(getActivity())
WiseFy.getSmarts().enableWiFi(getActivity());
```

To get current network:

```java
WifiInfo wifiInfo = WiseFy.getSmarts().getCurrentNetwork(getActivity())
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)
List<ScanResult> scanResults = WiseFy.getSmarts().getNearbyAccessPoints(getActivity(), true);
```

To get the networks whose configuration is already stored:
Expand All @@ -75,7 +75,7 @@ List<WifiConfiguration> savedNetworks = WiseFy.getSmarts().getSavedNetworks(getA
To check and see if a network is secure (WEP/PSK/EAP capabilities):

```java
boolean secure = WiseFy.getSmarts().isSecure(scanResult;
boolean secure = WiseFy.getSmarts().isSecure(scanResult);
```

To reconnect to a network given an SSID:
Expand Down