How to receive text sms to a specific port? I have been looking for an answer to this question but to no avail. This has been asked a few times but nobody seems to have a cl
[NOTE: The code that i have mentioned below is not working on the emulator but successfully on my LG P350 having Android V2.3]
I have used the demo code given on mobiForge but have changed the sendTextMessage() to sendDataMessage() with PORT_NO as 8901 (also converted text data to byte[] data). My receiver is:
<receiver android:name=".SMSReceiver">
<intent-filter>
<action android:name="android.intent.action.DATA_SMS_RECEIVED" />
<data android:scheme="sms" />
<data android:port="8901" />
</intent-filter>
</receiver>
A working example is KRVarma's SMSDemo which is also functional.
Thanks for the hint!
I use this and it works:
<receiver android:name=".SMSReceiver">
<intent-filter android:priority="10">
<action android:name="android.intent.action.DATA_SMS_RECEIVED" />
<data android:scheme="sms" />
<data android:port="50009" />
</intent-filter>
</receiver>