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?
Related
I’m working on an Android application that communicates with a Socket to a hardware device that serves a WiFi access point. This WiFi access point does not provide access to the Internet. I’m unable to connect to the socket while Mobile Data on the phone is turned on.
How can I communicate with this device without requiring the user to turn off mobile data? I don’t need to communicate with the Internet over the mobile data connection at the same time as I am communicating with the device over WiFi, but I would like to be able to switch back and forth.
I’ve tried binding the socket to the IP address associated with the network interface connected to the WiFi access point, but that didn’t work.
I have a webserver that is running on a network that is not connected to the internet.
The webserver serves up a website.
When I connect an android phone to it, I am able to run the website that is on the webserver
But with certain phones that are running Android 11 I need to disable the mobile data on the phone before it will try to access the website over wifi. It seems the phone will not try to request the url on the wifi network because it doesn't have internet, so it defaults to using the 4G/5G Cellular internet connection. This is too bad, because I would like the phone to use the wifi connection.
I would think that perhaops I could "force" the phone to use the wifi connection by typing the IP address in the browser's URL bar (eg. http://192.168.211.1/index.php), however it seems that even with the "local ip" it will still try to use the 4G/5G network instead of the "offline wifi" network.
The only workaround I have found is to disable moblie data on the phone, but this is not ideal.
I would think that some IoT devices would have an offline webserver used for configuation/control.
Is there a certain port or settings I should be using?
Is there a designated port that the browser/OS would expect to be on an offline network?
Basically, how can I make the phone use the wifi, even though the wifi is not connected to the internet?
Thanks so much for any pointers!
Say I have a laptop (Windows 10) and an Android phone. The laptop does not have an internet connection and the Android does not have an internet connection.
I have an Xamarin app that uses a C# Web API that is deployed to the laptop (for testing). How can I connect the mobile to the laptop without any form of internet connection? I believe I have two options:
1) USB cable
2) Bluetooth
I believe I have to install a wireless hotspot on the laptop and then a reverse tethering on the Android.
Have I understood this correctly? Do I have to do this regardless of whether I use a USB cable or a Bluetooth connection.
Tethering is the name given to a mobile that acts as a hotspot. It make use of a network interface (Wifi, Bluetooth, USB port acting as Ethernet...) to share internet connection through the selected interface.
As you'll note I'm not incluiding mobile data in the list. Mobile data is used to connect to Internet. So your mobile is capable of connecting to internet via mobile data and share it via any other interface, i.e. Wifi, Bluetooth and USB (Ethernet)
At least in my mobile im able to just enable Tethering configuring it from Settings -> Wifi connections -> Share internet. Here I can switch on/off the desired interface: USB, bluetooth or Wifi. I can enable just one, both or even all of those
As far as I know a Xamarin app is an android app that embeddes a website and, optionaly but highly common, uses a server as an endpoint (your laptop in this case), also known as API.
So as you ask you don't want to have internet connectivity, all the connections must be made in a local network. To do so you could just enable tethering and turn off mobile data on your mobile. Then on your laptop, connect to your new network over wifi, enable ethernet or connect via bluetooth, depending on your choose.
Of course, you'll have to handle firewall on your laptop to ensure connections are made successfuly. But you should be able at last to ping each other.
I am trying to make an android application that will stream live sensor data (e.g. accelerometer, etc) from my android device to my desktop computer.
My android device is connected to a WiFi network and my desktop computer is connected to a network with an Ethernet cable.
There are android applications available that send data from an android device to a PC via WiFi, but both devices must be connected to the same network.
Is there a way to transfer data if the two devices are connected to different networks?
Thank you!
Due to the fact that nearly every network sits behind a firewall (in most cases your home router/nat-device) you need to implement port-forwarding to access network 2 from network 1.
Another aproach would be to set up a VPN (f.i. with SSH) between the 2 hosts.
If your PC is directly connected to the internet, and has a public ip (that means, if you have NOT a RFC 1918 Adress), then you are able to directly connect to that ip by just entering that ip. If not, you need to implement something to get behind the firewall.
Simple answer; to stream data between a PC and an Android device each residing on different networks you need an intermediate server to pass the data through.
Now, if this just a small app that you are doing for your own purpose I suggest using the free version of Firebase (see https://www.firebase.com/). Their sample application that you'll find there, a simple chat service, does pretty much exactly what you need. Simply let the application on your PC (preferably a web app) read the "messages" that you send from your Android device.
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.