Android UDP issues with WIFI connection
-
Hi all Android/Qt experts.
I have a strange issue with
QUdpSocket
and Android.
I have create an application which communicates through UDP socket with a device on WLAN.
My WLAN is a private network without access to the internet.
All works fine as long as there is no SIM card in my Android device.
As soon as Android is connected to Internet through the mobile network, no more UDP datagramme are sent to my device.There is no broadcast messages, all messages are sent as unicast!
I use Qt 5.12 and Android 7/11.
What can I do to solve this issue?
Is it a Qt or Android issue?Can someone give me an explanation or a workaround?
Thanks in advance for any help.
-
@KroMignon I'm answering myself in case anyone else faces a similar issue.
To solve this issue, I had to use
ConnectivityManager.bindProcessToNetwork()
to force Android to use the network I want to!