How to prioritize the wifi connection of the device even without internet?

0

I have an application (Android / iOS) that runs on a local wifi network (which has no internet).

This wifi network does not have internet, devices prioritize 3G / 4G, so my application (local API) does not work.

I have tried to find out if there was any way to programmatically disable the device's mobile data, but without success because Google and Apple do not allow it.

Today, as an alternative, I only show a button for the user to enter the settings of the device, which I think is a good solution, but not the best in my case, because my target audience are elderly people who have many difficulties in operating the device .

What I would like is that I somehow did not have to enter the device settings. I know my scenario is complicated, but is there an alternative?

Note: it is mandatory for the wifi network not to have internet, most of the public are elderly.

    
asked by anonymous 29.08.2018 / 15:12

1 answer

2
Quiet to do that. you need to have a web server on your wifi network that responds to both android and apple requests.

All devices (smartphones, computers, devices that access the Internet) make an HTTP request for a certain url to know whether or not there is internet in the network, the same request is used to identify how much has a captive portal but the difference of the captive portal is that it does a redirect in the request http 302, and what you need is a web server (local) that responds to these requests

As an example I leave you with the url that an Apple device makes the request [ link the answer is Success

Response html code:

<HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>

EDIT: You will need the following services running on it. Web, PHP, and DNS, as well as the basics.

  

1 - You must configure the DNS server to distribute ip on your internal network and pointing as DNS server itself, as it will solve the searched domains, pointing to the ip address of the machine that will respond to the requests HTTP, in the case itself.

     

2 - You must create a virtual host on your web server to deliver the index.php page

Content index.php page to respond to 200 (has internet), and maintains the connection of the devices.

<?php
    header("HTTP/1.0 200 OK");
?>

With this answer, all android or apple devices will stay connected to the wifi network, because they thought it has internet.

    
28.09.2018 / 22:12