Sending a SMS to the current device within Android JUnit test
<p>Im using the following code in a JUnit test to send a SMS to the current device:</p>

<pre><code>// Get device phonenumber
TelephonyManager telMgr = (TelephonyManager) getActivity().getSystemService (Context.TELEPHONY_SERVICE);
String phoneNumber = telMgr.getLine1Number();
// Send SMS
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber, null, "sms body", null, null);
</code></pre>

<p>Tested in the emulator but this doens't work, i have set the PHONE_STATE and set SEND_SMS permissions.<br>
Does anybode know a better way to write a test that sends a SMS to the current device. (not using adb)</p>
