title: how to receive text sms to specific port..
body: <p>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 clear answer. My code is as follows:</p>
  
  <p>--MANIFEST FILE-- </p>
  
  <pre><code>&lt;receiver android:name=".SMSRecieve" android:enabled="true"> 
  &lt;intent-filter> 
  &lt;action android:name="android.intent.action.DATA_SMS_RECEIVED"/> 
  &lt;data android:scheme="sms" /> 
  &lt;data android:host="localhost" /> 
  &lt;data android:port="15005" /> 
  &lt;/intent-filter> 
  &lt;/receiver></code></pre>
  
  <p>--SMS sending method-- </p>
  
  <pre><code>String messageText = msgTxt.getText().toString(); 
  short SMS_PORT = 15005; 
  SmsManager smsManager = SmsManager.getDefault(); 
  smsManager.sendDataMessage("5556", null, SMS_PORT, messageText.getBytes(), null, null); </code></pre>
  
  <p>--Broadcast Receiver code-- </p>
  
  <pre><code>static final String ACTION = "android.intent.action.DATA_SMS_RECEIVED"; 
  //static final String ACTION = "android.provider.Telephony.SMS_RECEIVED";(tried this too, but failed) 
  
  if (intent.getAction().equals(SMSNotifyExample.ACTION)) { 
  ...do some work.. 
  }</code></pre>
  
  <p>I also tried to replace <code>android:name</code> to <code>android.provider.Telephony.SMS_RECEIVED</code> but the result is the same. </p>
  
  <p>My application does not receive the SMS on the specified port. Once I remove the following line it works fine:</p>
  
  <pre><code>&lt;data android:scheme="sms" /> 
  &lt;data android:host="localhost" /> 
  &lt;data android:port="15005" /> </code></pre>
  
  <p>Could you suggest what am I missing?</p>