I am using the command line argument in my android application, for example:
ProcessBuilder pb = new ProcessBuilder(cmds); Process process = pb.start(); process.waitFor();
Where cmds is a list of arguments to run. My teams validate the remote URL through an http connection. My device is connected to a WiFi network that does not have access to the Internet, but hosts a URL that I want to check. My device also has a cellular connection that has access to the Internet, but not a URL. Android 6.0 Marshmallow runs on my device.
Typically, in Lollipop or higher, Android is by default used on a network with an Internet connection. In order to access Wi-Fi networks without the Internet, you need to use NetworkRequest , for example: https://stackoverflow.com/a/212616/169 .
How to transfer the received Network above Process so that the connection passes through my WiFi network, and not my cellular network?
Do I need to use ConnectivityManager # bindProcessToNetwork ? How do I join a process to configure a network using this method? It seems that there is no way to give this process.
android android-6.0-marshmallow networking wifi connection
Jon g
source share