Thank You a lot.

It was very helpful.

I use such code for SMS (send/receive) registration

ContentResolver contentResolver = getContentResolver();
Handler handler = new Handler();
m_SMSObserver = new SMSObserver(handler);
contentResolver.registerContentObserver(Uri.parse("content://sms"),
true, m_SMSObserver);

And this code for separating send/receive events

Uri uriSMSURI = Uri.parse("content://sms");
Cursor cur = this.getContentResolver().query(uriSMSURI, null, null,
null, null);
cur.moveToNext();
String protocol = cur.getString(cur.getColumnIndex("protocol"));
if(protocol == null)
        onSMSSend();            
else
        onSMSReceive();         

I hope that it'll be useful for others.

Geos

On Fri, Feb 27, 2009 at 9:35 PM,  <mark.ka...@gmail.com> wrote:
>
>
>  Thanks for the info, the content observer works, Using pending
> intents with the SmsManger does not seem to work, the intent gets
> broadcast that the message was sent, even if you have no signal or SIM
> card in the device, the content obsever does actually tell if the
> message was sent from the device reliably. Good to know.
>
>                  Mark
>
>
> On Feb 27, 4:13 am, jarkman <jark...@gmail.com> wrote:
>> Take a look 
>> here:http://groups.google.com/group/android-developers/browse_thread/threa...
>>
>> and here:http://code.google.com/p/android/issues/detail?id=914
>>
>> Basically, you can do it by registering a content observer on the SMS
>> message store. But the details are not in the SDK, which is either a
>> simple omission or a hint that they may change in the future. Try
>> this:
>>
>>   ContentResolver contentResolver = context.getContentResolver();
>>   contentResolver.registerContentObserver(Uri.parse("content://
>> sms"),true, myObserver);
>>
>> Richard
>>
>> On Feb 27, 2:36 am, Geos <george.kremenet...@gmail.com> wrote:
>>
>>
>>
>> > Please help.
>>
>> > Who knows how to detect SMS sending from the phone?
>> > I saw a lot of posts about android.provider.Telephony.SMS_RECEIVED but
>> > it's only for SMS receiving.
>> > May be You can suggest some forums where I can ask specialist from
>> > Google about it?
>>
>> > Thank You.- Hide quoted text -
>>
>> - Show quoted text -
> >
>



-- 
With best regards,
George Kremenetsky
http://www.geos.kiev.ua
http://www.inventcreator.com
e-mail: george.kremenet...@gmail.com
skype: george.kremenetsky
Mob. tel. +380 50 440-33-31

--~--~---------~--~----~------------~-------~--~----~
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