Android : UDP multicast on HTC phones -
ok i've written application sends , receives multicast udp packets. application works on samsung s3 doesn't receive packets on htc explorer running android 2.3.5. on farther research i've found out phones not back upwards udp multicasting altogether. want create sure application works on phones. can enable multicasting on htc phones? , if not there other solution problem?
i ran same problem on htc 1 running android 4.1.2
here's solution solved me android bug report:
wanting receive broadcasts in async routine utilize next code before loop broadcast messages received: wifimanager wifi; wifi = (wifimanager) getsystemservice(context.wifi_service); multicastlock ml = wifi.createmulticastlock("just tag text"); ml.acquire(); when asynctask stops ml.release();
i had include next in androidmanifest.xml:
<uses-permission android:name="android.permission.access_wifi_state" /> <uses-permission android:name="android.permission.change_wifi_multicast_state" />
android udp multicast
No comments:
Post a Comment