Git Product home page Git Product logo

Comments (6)

mvdan avatar mvdan commented on June 19, 2024

You mean when someone connects or disconnects from our AP?

from accesspoint.

pserwylo avatar pserwylo commented on June 19, 2024

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.

mvdan avatar mvdan commented on June 19, 2024

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.

luispereira avatar luispereira commented on June 19, 2024

Isn't this what you are looking for?

android.net.conn.TETHER_STATE_CHANGED

from accesspoint.

mvdan avatar mvdan commented on June 19, 2024

@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.

mvdan avatar mvdan commented on June 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.