Note that there are some explanatory texts on larger screens.

plurals
  1. POreceive sms sent to a particular port
    primarykey
    data
    text
    <p>It is a recurrent question but I wasn't able to find a complete enough documentation on this topic.</p> <p>I already have a working application able to intercept SMS, when it is send with default parameter with kannel or other device. My manifest look like this :</p> <pre><code>&lt;receiver android:name=".sms.SMSListener" android:enabled="true" &gt; &lt;intent-filter&gt; &lt;action android:name="android.provider.Telephony.SMS_RECEIVED" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; </code></pre> <p>It works both with <code>android.provider.Telephony.SMS_RECEIVED</code> and <code>android.intent.action.DATA_SMS_RECEIVED</code>.</p> <p>But for the purpose of my application, the SMS must not appear in the user-inbox. For that, kannel sent the SMS to a specific port. It is already working on Blackberry, so I guess the sending part of the problem is already working. Also it may be possible to achieve this goal via other means, I need to implement this solution in order to stay coherent with other similar project. Another reason for that, is to avoid my <code>BroadcastReceiver</code> to be fired at each received SMS (and thus needing to parse each received SMS).</p> <p>However with my current manifest, I don't receive SMS sent to a specific port (my receiver isn't fired at all). After some research, I found those topic <a href="https://stackoverflow.com/questions/2726976/how-to-receive-text-sms-to-specific-port">how to receive text sms to specific port..</a>, <a href="https://stackoverflow.com/questions/3757229/android-how-to-send-and-receive-data-sms-messages">How to send and receive data SMS messages</a>. Someone say that adding :</p> <pre><code>&lt;data android:scheme="sms" /&gt; &lt;data android:port="1234" /&gt; </code></pre> <p>is enough to work (unfortunately, it doesn't works for me). However according to the documentation ( <a href="http://developer.android.com/guide/topics/manifest/data-element.html" rel="nofollow noreferrer">http://developer.android.com/guide/topics/manifest/data-element.html</a> ) you need to specify the <code>android:scheme</code> then the <code>android:host</code> in order for <code>android:port</code> to be taken into account. As far as I understand the documentation, you could just specify <code>android:scheme</code> and the intent-filter should still be functionnal. However as soon as I specify the <code>android:scheme</code>, my <code>BroadcastReceiver</code> cease to work, whether or not I send the sms with a specific port :</p> <pre><code>&lt;receiver android:name=".sms.SMSListener" android:enabled="true" &gt; &lt;intent-filter&gt; &lt;action android:name="android.provider.Telephony.SMS_RECEIVED" /&gt; &lt;data android:scheme="sms" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; </code></pre> <p>So my questions are the following:</p> <ol> <li>is there somewhere a documention about which value <code>android:scheme</code> can take ?</li> <li>which value should I use for <code>android:host</code> ?</li> <li>is there somewhere an app which listen SMS to every port so I can be sure that the test SMS is correctly sent (just to double check this part) ?</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload