WiseFy
Wifi configuration and util library built for Android.
Developed by Patches 04/24/2016 - present
Supports Android SDK levels 16-26
What's New in 2.x
- Asynchronous API
- Certain methods have callbacks and are run on a WiseFy specific background thread
- Ability to search by regex for:
- Nearby access points
- Saved Configurations
- SSIDs
- Ability to query for RSSI
- Ability to query for if the device is roaming
- Additional methods to query for network security
- Full fledged documentation directory
- Tested against Android O
Adding to your project
Make sure you have one of the following repositories accessible:
repositories {
jcenter()
}
repositories {
mavenCentral()
}
repositories {
maven {
url "http://dl.bintray.com/isupatches/Maven"
}
}
Then add it as a dependency (please see https://github.com/isuPatches/WiseFy/releases for the latest version):
For Gradle:
compile 'com.isupatches:wisefy:<LATEST_VERSION>'
For Maven:
<dependency>
<groupId>com.isupatches</groupId>
<artifactId>wisefy</artifactId>
<version><LATEST_VERSION></version>
<type>pom</type>
</dependency>
You may also download the @aar from the releases page and import it into your project manually.
Getting An Instance
WiseFy is constructed with the builder pattern that allows you access to the synchronous and asynchronous APIs.
To grab a default instance:
WiseFy mWiseFy = new WiseFy.brains(getActivity()).getSmarts();
To grab an instance with logging enabled:
WiseFy mWiseFy = new WiseFy.brains(getActivity()).logging(true).getSmarts();
Cleanup
Since the Async API of WiseFy is run on a background thread, it is necessary to make sure it is exited and cleanup up properly.
To stop the WiseFy thread and nullify it along with it's handler please call:
mWiseFy.dump();
Permissions
For the sake of transparency and because you're probably curious as to what permissions this library adds to your app, here are the additional expected permissions:
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
* NOTE *
If access points or SSIDs are not being returned on >= 6.x devices but there are visible networks, it's most likely because you haven't asked in your application for the Manifest.permission.ACCESS_COARSE_LOCATION
permission which is what allows us to see the access points nearby. This permission request will not be added to the WiseFy library to reduce package bloat and so users can determine their own UI/UX.
Please check the permssions example for a sample of how to request permissions for WiseFy.
Usage
Please check the documentation markdown directory for usage examples and details about both the synchronous and asynchronous API.
License
Copyright 2017 Patches Klinefelter
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.