android7.0 组播 权限,android组播开发(2.3.7以下无法正常接收组播)

android的组播真是够麻烦的

1. 打开权限

2. 打开组播锁,默认时,移动设备为了省电是关闭的

WifiManagerwifi=(WifiManager)getSystemService(Context.WIFI_SERVICE);if(wifi!=null){MulticastLockmcLock=wifi.createMulticastLock("mylock");mcLock.acquire();...

3. 模拟器玩wifi还是很痛苦的,莫名其妙的错误和失败

4. 真机玩wifi组播也很要命,根据stackoverflow,android2.3.7以下的系统只能接收自己发送的组播消息,无法接收其他设备,包括移动设备,PC等发送的组播消息

I've been doing a bit of research into this, and I believe it is a problem with Android in general, and fixed in or around Android 2.3.7.

It's a bit too anecdotal, but here's what I tested:

HTC Desire, 2.2, stock: fail

HTC Desire, 2.3.7, CyanogenMod: success

Motorola Milestone, 2.1-update1: fail

HTC Desire S, 2.3.3: fail

Acer Iconia A501, 3.2.1: success

Samsung something, 2.3.3: fail

HTC Legend, 2.2 I think: fail

When I say 'fail', in fact they were all able to send multicast messages to the 'success' devices, but never receive anything back except their own messages - as jldupont describes.

手头只有一台老旧的索爱X8,android2.1, 接收组播异常

一台小米1s,android4.0,可以正常接收PC的组播

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值