HttpServer & HttpJob, I have the server starting a wifi hotspot and opening up a http port. The clients will connect to the hotspot and search for the open ports.
This works great with devices that don't have any mobile cell data connection. When I try to use my cellphone, since the hotspot doesn't have 'internet' access, it gives it limit connection status and uses the cell data network instead. I lose my ability to connect to the local httpserver hotspot ipaddress (192.168.43.1). As soon as I disable mobile data, the cell phone is forced to use the wifi connection and connects to the httpserver.
Now I don't want to 'turn' off mobile data when I run the program, I still want to receive calls and texts while the program is running on my cell phone. But is there a way to force using the wifi connection even though there is no internet on it? When the program is paused, it can go back to using mobile data. On resume, force to use wifi.
*edit. Doing more reading, it looks like depending on what a Android version you have will act differently. Early versions would only let you connect to either WiFi or mobile. In lollipop, you can connect to WiFi (with no internet) and still get internet over mobile.
ConnectivityManager looks to be the answer.
https://developer.android.com/about/versions/android-5.0.html#Wireless