androidwebserverwifitetheringcaptivenetwork

Captive portal on android device


I am using my android device as a mobile web server. I want to direct every user that connects through my portable Android hotspot to a specific wellcome page.

Does anybody know how to implement this technique in my device (I believe this is called the captive portal technique)?


Solution

  • I answer my own question until someone shares some useful information on how to implement the captive portal in a non-rooted device.

    At the moment I am not aware of such working solution.

    Captive portal works by intercepting most network packets (using a firewall), regardless of address or port, until the user opens a browser and tries to access the web. At that time the browser is redirected to a web page which may require authentication et.c.

    So for a captive portal solution to exist, many parts like a software firewall/router/webserver need to integrate and cooperate. Given the current restrictions/permissions in a non-rooted phone, I now believe that such application won't likely exist.

    @mmm2006: However, if you do have a rooted device there are apps like Paywall that can do the trick for you.

    You can also try to implement your own captive portal solution. It's not trivial but since Android is based on the Linux kernel, you could try something like these: