问题描述
我的应用程序有一个静态广播接收器侦听特定数据的短信端口50011醒来并运行应用程序。
我测试了广泛的Android设备的应用(Android 2.1 - >安卓2.3.4),并且可以正常使用。
不过,我现在想它三星GALAXY Nexus运行Android 4.0.2,它是未能接收二进制短信。
操作系统似乎没有消耗的短信,因为它没有显示在logcat中的任何相关消息。
是任何人都熟悉这个问题?这是非常紧迫:•
感谢
下面是我在清单中写道接收器部分。
<接收
机器人:名字=SmsListener。>
<意向过滤器的android:优先=10>
<作用机器人:名字=android.intent.action.DATA_SMS_RECEIVED/>
<数据机器人:计划=SMS/>
<数据机器人:主机=本地主机/>
<数据机器人:端口=50011/>
&所述; /意图滤光器>
< /接收器>
原来,直到它的一个活动是由用户发起,应用程序将无法注册其广播接收机
在我的情况下,应用程序不包含任何活动。
我添加了一个活动,并将其重新工作。 :D
谢谢大家对你的帮助。
My application has a static broadcast receiver that listens to specific data sms on port 50011 to wake up the application and run.
I tested the app on a wide range of android devices (android 2.1 -> android 2.3.4) and it is working perfectly.However, I am trying it now on Samsung Galaxy Nexus running Android 4.0.2 and it is failing to receive the binary sms.The OS doesn't seem to consume that SMS as it is not showing any relevant messages in logcat.
Is anyone familiar with that issue? It's very urgent :S
Thanks
Here is the receiver part that I wrote in the manifest.
<receiver
android:name=".SmsListener">
<intent-filter android:priority="10" >
<action android:name="android.intent.action.DATA_SMS_RECEIVED" />
<data android:scheme="sms" />
<data android:host="localhost" />
<data android:port="50011" />
</intent-filter>
</receiver>
It turned out that the application will not register its broadcast receivers until one of it's activities was launched by the user.
In my case the app didn't contain any Activity.
I added an activity and it is working again. :D
Thanks everyone for your help.
这篇关于Android的ICS不接收数据的短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!