Hi,

I'm experimenting with sending SMS text messages from one emulator to
another. The blueprint of the code is as given below. The SMS message
is sent successfully to the target emulator. In the code I receive the
broadcast received when the SMS is sent sucessfully (e.g. I see the
message "Received SENT-onReceive" in the logcat). However, I never
receive the broadcast receiver when the SMS is delivered sucessfully
(e.g. I don't see the message "Received DELIVERED-onReceive" in the
logcat). Has anyone experienced a similar behavior before? My source
emulator is (Target Name: Google APIs; Platform: 2.1-update1; API
Level: 7) and my target emulator is (Target Name: Android 2.1-update1;
Platform: 2.1-update1; API Level: 7).

Thank you in advance,

String phoneNum = "5556";
String SENT = "SMS_SENT";
String DELIVERED = "SMS_DELIVERED";

this.registerReceiver(new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.i(TAG, "Received SENT-onReceive");
        .
        .
    }
}, new IntentFilter(SENT));

this.registerReceiver(new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.i(TAG, "Received DELIVERED-onReceive");
        .
        .
    }
}, new IntentFilter(DELIVERED));

String message = "Test SMS message";
PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, new
Intent(SENT), 0);
PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0, new
Intent(DELIVERED), 0);
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNum, null, message, sentPI, deliveredPI);

-------------------------------------------------
Ali Chousein
Weather-Buddy
http://weatherbuddy.blogspot.com/ | http://twitter.com/weather_buddy
Geo-Filtered Assistant
http://geo-filtered-assistant.blogspot.com/
https://marketplace.cisco.com/apphq/store/products/994

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to