I am developing an app which listens to incoming sms. I have added the permission:
<uses-permission android:name="android.permission.RECEIVE_SMS" />
to my app manifest. And yes, it is not inside the receiver tag.
I am trying to test the app by sending a sms from one emulator to another. My logcat gets the following entry :
WARN/ActivityManager(66): Permission Denial: receiving Intent { act=android.provider.Telephony.SMS_RECEIVED (has extras) } to com.android.LUC requires android.permission.RECEIVE_SMS due to sender com.android.phone (uid 1001)
The weird part is that when I am testing the app on emulator running android 3.2 it works fine!
App Manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.sms"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<application android:icon="@drawable/icon" android:label="@string/app_name" android:permission="android.permission.RECEIVE_SMS">
<activity android:name=".TestSMSReceiveActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".mysmstestcall" android:enabled="true">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
</application>
</manifest>
mysmstestcall is the broadcastreceiver class and TestSMSReceiveActivity is the main activity. The app fails to receive message in emulator running android 2.2. Please help!!