How to force the HTTP connection over Wi-Fi instead of cellular in Android?

前端 未结 3 1849
清歌不尽
清歌不尽 2020-12-19 20:21

My application has to detect that the device connected to the Wi-Fi network is the required one and then fire a HTTP request over that Wi-Fi network programmatically. I have

3条回答
  •  自闭症患者
    2020-12-19 20:39

    You can use OkHttp and a custom SocketFactory. See https://github.com/square/okhttp/issues/2404 for more details.

提交回复
热议问题