【发布时间】:2014-08-06 00:20:29
【问题描述】:
我为 Galaxy s5 (Kitkat 4.4.2) 编写了短信应用程序来接收/发送短信。一切正常,但我的应用程序写入 SMS 提供程序,因此可能应用程序必须是默认的 SMS 应用程序。我根据 -http://android-developers.blogspot.com/2013/10/getting-your-sms-apps-ready-for-kitkat.html 添加了所需的权限。但我不想阅读/发送彩信。是否可以通过本机短信/彩信应用程序接收彩信(无默认)并通过我的应用程序接收/发送短信(默认)?我知道要发送 mms 本机应用程序必须设置为默认值,但我只是在考虑接收。现在我的应用程序是默认的,我有空的彩信接收器,当用户收到彩信时它会丢失。
嗯....也许我可以在onReceive() 方法中从我的应用程序将彩信保存到 SMS 提供程序,然后启动本机(非默认)短信/彩信应用程序来显示它们?这是个好主意吗?我该怎么做?
MmsReceiver
public class MmsReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
}
}
清单.xml
<receiver
android:name="com.mateusz.simplesmsapp.broadcasts.MmsReceiver"
android:exported="true"
android:permission="android.permission.BROADCAST_WAP_PUSH" >
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVE" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
【问题讨论】:
标签: android android-manifest android-4.4-kitkat android-broadcast mms