Does the Android OS manage networks so that it's connected to the most ideal one? I have an app that is hard-coded to connect to a local network that has no internet access but as soon as it connects to the network it then switches back to my home's WiFi (which has internet connection). If I make the OS 'Forget' my home network I don't get this see this issue but that isn't exactly a practical solution.
Related
Is it possible to dedicate a WiFi network (to a device with no internet access) to a socket in an app and keep Cellular network as the default internet connection for the Android device (and other network requests from the app)? (Android 5 & 6)
I can easily switch between WiFi and Cellular within the app but the main issue is when WiFi is up, Internet is not accessible anymore for the app and all apps already running on the device (i.e. streaming music, web browser, ...)
I have tried to bind the Wifi network to the process or a socket but I can't find any way to do that with getting the network active (and at this point Android just try to route all the internet traffic to the device...).
My understanding is that Android 5 & 6 provides more flexibility to route traffic to multiple networks at the same time but I think I'm missing something here...
As per the Connecting your App to a Wi-Fi Device blog post:
Alternatively, if you’d like to route some of your app traffic to the Wi-Fi device and some to the Internet over the mobile network:
For HTTP requests you can use Network#openConnection(java.net.URL), directly routing your request to this network.
For low-level socket communication, open a socket and call Network#bindSocket(java.net.Socket), or alternatively use Network#getSocketFactory.
I have an application that needs to connect to a wifi network, but this wifi network has a captive portal in which you have to make a click in a button to get internet access in that network.
My problem is that in android 5.0 and higher the OS do not connect the wifi network because it first checks if the wifi network has internet access if a mobile network with internet access is present. I want to connect to the wifi network even without internet access because i want to handle the captive portal in my app.
Is there a way to do this? because android detects it is connected to the wifi network but because is has no internet access it still uses the mobile network adapter.
I know that one option is to redirect all the traffic from my app to the wifi adapter but I would rather to not do that. But to just tell android to connect to the wifi network even without internet.
Thanks!
I have a device that creates a WiFi network that is not connected to the internet. This device hosts a website using IIS. To operate the device, a smartphone connects to the WiFi and browses the site. The smartphone needs to get data from an api (internet) and pass it to the website on the device.
I have tried to remove the default gateway setting from the DHCP server on the local WiFi, but this is not permitted on the device.
I have not been able to find an app that will allow both WiFi and Cellular data to be used simultaneously.
If I were to allow the device to connect to a hot spot that the smartphone creates, the smart phone cannot access the device's WAP.
The next option I'm considering is to toggle the WiFi Off and On during the process.
I'm wondering if anyone has another solution to this issue?
I am working around wifi direct and NSD (Network Service Discovery) to transfer files.
NSD: where serivce has been created and can scan the other devices which are publishing the same service with in the same network.
WiFi Direct: This is used to scan the near by devices without network
WiFi P2P Network Serice Discovery: This is used scan the service near by devices where other devices provide the same service (NSD+WiFi Direct)
As per requirement, I need to give compatibilty to iOS device even though both are not in same network. I came to know that NSD is similar to Bonjour service by iOS.But this can be possible when devices are in the same network.
Is there any way to get connect to iPhone when both are not in same not network?
Ignoring the intricacies of getting Android and iOS to play nice together, it is possible to make them think they are in the same network without physically being there. If I understand you correctly, seems like you have two options:
Setup up a VPN server in network A and the device in network B connect to it. This would make the device in network B think it was on network A, and have access to all LAN services (such as NSD).
Set up VLAN trunking on a switch and put network A in the same network as B.
Option 2 would only work if they were geographically in the same area (like on the same campus). Option 1 would be preferable if they were geographically disparate, or you were unable or unwilling to make the infrastructure changes necessary to support option 2.
Since I don't have an Android 4.0 device I haven't been able to test this myself. Also I wonder if connecting device A (a smartphone) to device B (a wifi direct capable device) using Wifi direct would mean that device A would assume it is provided with internet from device B (tethering?). I am trying to make an application for device A that would communicate with a device B that does NOT provide internet, thus it would be interesting to know if such a scenario would lead to device A losing internet connectivity for the duration of the connection. Is the situation different depending on if device A is connected to internet through an AP or through 3G/4G?
Perhaps using Bluetooth would be a solution, but in my case security is an issue, and it seems to me that Wifi direct provides stronger security (WPA2).
Any info would be helpful!
/S
On Android, Wi-Fi Direct doesn't interfere with your connection to the Internet (Wi-Fi or 3G/4G). A problem may be that once your turn on the Wi-Fi (to enable Wi-Fi Direct, your phone will try to connect to one of the saved available networks and will disable your 3G connection. That is because Android (by default) doesn't support dual connection (via both Wi-Fi and 3G/4G), but there is some applications around that claim that they can provide such functionality.