Is it possible to detect if the device has Hotspot enable? - react-native

I have to find if the device where my application run, has the Wi-Fi enable or if the device is in hotspot mode, else I want to display an error message.
To detect if I am connected to Wi-Fi, I'm using #react-native-community/netinfo, but I can't find anything about the hotspot for react native.
The only things I want are to know if the hotspot is enabled on my device (and, if possible, if there are devices connected to this hotspot).
Thank you for your help.

Related

React Native Expo can't connect from phone to laptop on same wifi

I am building react native app with expo and I'm currently using public wifi because I'm traveling.
On the bus and in the hostel's wifi I've experienced an issue:
- Phone can't connect to Expo running on Laptop (same LAN wifi)
After trying many times to connect using the wifi, and also trying to see if Windows firewall has something to do with it, I finally found out what might be the issue and a temporary workaround.
Issue:
Some routers have a configuration called AP Isolation, that might be activated on the router/wifi of the public place you're using, to avoid someone hack into someone else's computer. So basically no device on the same network can communicate with the other.
Temporary workaround:
The only way I've got this working was by enabling a Wifi Hotspot on my Android phone and connecting the laptop to it. This means I'm using my phone's 4G connection for internet too. Expo seems like it needs to access the Internet and if you don't have data won't work.
The other way might work is if your Windows or Mac computer is able to create a virtual access point. So instead of connecting laptop to phone, you do it the other way around.
Hope this helps someone!
You should be able to run on a virtual device via expo. On my Macbook I run on iOS if doing work in a place where I do not have internet but on a PC you should be able to run the Android Emulator.
While this might not provide the not intuitive way of doing things as you'll be using a virtual device instead of a physical one, it still is very quick and responsive. Just know that animations may not be as smooth.
I fly frequently and running on virtual devices has enabled me to work when otherwise it would be impossible.

React-Native simulate device is disconnected

Turning genymotion (or device) wifi causes app be unable to connect to app bundle and goes to show the red error in react-native. So how can I simulate app behavior when is disconnected from the internet (and also developing to have a good react (I mean it's not just about testing, also developing))?
There are only 4 states possible:
connected with good connection (have access to remote servers)
connected with poor connection (loss percentage is high)
connected with zero connection (have not access to remote servers - 100% loss)
not connected
Simulations way depends on which situation you need and where your app is running (device:iOS, Android?, simulator: mac, windows?)
On iOS you have Developer menu in the preferences and Network Link Conditioner in.
On Mac you can install Network link conditioner by this
I`m sure android has some tool for it.
Can`t say something about windows, sorry

Detect if device is connected to a specific network(office wifi)

I have an enterprise iOS app and I am trying to detect if the device running the app is connected to the office wifi.
I can't find relevant information and I am not sure if this is possible.

Share one android device for developing

We are several people (in different cities) developing on titanium. We have only one device to check how the application works on a real device.
Can we share somehow one device to check how application works on a real device?
The idea is to have one PC with remote access and Titanium running with connected git\mercurial repositories. Android device connected to this PC by USB. The user connects by Remote Control to the PC, pulls data from repository and runs application on the device.
The problem that we have is how to get access to screen of the Android device on the PC to control it.
Does someone have an idea how it could be organized?
This link (http://code.google.com/p/androidscreencast/) says it will help, but it has limitations. I guess this solution would make sense if you are doing most of the testing on the local emulator and the physical device is a final check for functionality.

If possible, how to connect iPhone to an external device and a router programmatically, both WiFi

I would like to create an application that connects to the internet by using WiFi. That's easy, but i also want to connect the iOS device to a standalone WiFi device. (Device is classified)
So basically i want to connect programmatically to two devices at once using a single WiFi chip
Is this even possible (couldn't find anything that proves so on internet). And if possible, how do i do it?
iOS device can't be connected to two different wireless networks at the same time.
Even more: you can't programmatically switch between the two networks - user has
to do it trough the settings application.
So: if the device is on the same wireless network as your router (gateway to internet) then you'll have no problems connecting iOS to internet and to your classified device.
However: if classified device is on a seperate (possibly AdHoc) network then user will have to switch between connection to internet and connection to classified devices's wireless network.
If you're the designer of classified device it would be best if you can manage the connection trough wireless access point. This would be the only way to connect iOS device to your classified device and internet at the same time.