Comments (6)
You mean when someone connects or disconnects from our AP?
from accesspoint.
Nah, this is for when the device with the AP running either enables or disables the AP. I misspoke in the original description by referring to it as "connects/disconnects". Sorry for the confusion.
from accesspoint.
I am guessing you also want to be notified whenever the AP is enabled or disabled by the user, not only the library.
I can't find any callback system in Android to do such a thing. So we have two options:
- Expect the app to call
isEnabled()
on an async thread repeatedly (e.g. every second) - We call
isEnabled()
on an async thread repeatedly (e.g. every second) and add a watcher/callback API to the library
I'm guessing the second is the best option. After all, this library is already hacky enough, with the reflection and all. Adding a callback system that internally polls should be fine, if we let the app define how often to poll (with a default to e.g. 1s) and as long as we don't do the polling work if no watchers are registered.
from accesspoint.
Isn't this what you are looking for?
android.net.conn.TETHER_STATE_CHANGED
from accesspoint.
@luispereira maybe - the docs say:
* Broadcast Action: A tetherable connection has come or gone.
* Uses {@code ConnectivityManager.EXTRA_AVAILABLE_TETHER},
* {@code ConnectivityManager.EXTRA_ACTIVE_TETHER} and
* {@code ConnectivityManager.EXTRA_ERRORED_TETHER} to indicate
* the current state of tethering. Each include a list of
* interface names in that state (may be empty).
I don't have time to work on this at the moment, but will review a patch.
from accesspoint.
Since there seems to be little interest to write this, I'm going to close this issue for now as I don't intend to work on it myself. Feel free to reopen or comment if you'd like to work on it.
from accesspoint.
Related Issues (15)
- provide method to get IP address HOT 3
- DHCP not working on Android 7.1 and later HOT 23
- Automatically detect WLAN device name on newer devices HOT 2
- Support for band and channel selection. HOT 3
- About AP's password HOT 1
- Android 7.1: Access point created but no internet connection HOT 1
- Not working on Samsung Galaxy S5 SM-G900V Android 6.0.1 HOT 9
- Logo offer for Accesspoint
- Only catch reflection exceptions HOT 1
- Remove getInstance() method with no args HOT 1
- Broken on 6.0+ HOT 13
- Is it possible to set the wifi channel? HOT 4
- Configurations are not applied HOT 9
- java.lang.NumberFormatException HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from accesspoint.