[android-developers] Re: Content observers for SMS mailboxes

2008-10-23 Thread Evan JIANG
The sms provider's source code is in
ROOT_OF_ANDROID_SOURCE_CODE/packages/providers/TelephonyProvider/SmsProvider.java
After had a look at that, I found you're right. It only send UriChange
notification on 3 Uris. I'm not sure if it's a bug.
You can register your content observer on content://sms. After get the
notifyChange, query the latest SMSes, and check the sent flag to judge is it
a sent sms or received sms.

Regards,
Evan JIANG

On Fri, Oct 24, 2008 at 8:22 AM, denismo [EMAIL PROTECTED] wrote:


 Hi,

 I've spent several days trying to figure out how to listen for sent
 SMS. One thing that I tried is content observers on content://sms/sent.
 That didn't work.  Then I tried content://sms/inbox. That didn't work
 either.

 In my scenarios, I was doing two things:
 - sending SMS to emulator using telnet sms send some number some
 text. This generates notification in the notification area, and you
 can read the sms later, but content observer on content://sms/inbox is
 not invoked
 - sending SMS from one emulator to another. I had one on 5554, another
 on 5556. I had content observers on both on content://sms/inbox and
 content://sms/sent and I was sending sms from 5554 to 5556 using
 sendTextMessage(5556, null, ...). I saw SMS being received by 5556,
 there was notification and I could read the SMS on 5556. None of the
 observers were invoked.

 So now I start wondering if content observers are at all support for
 SMS content provider?  The same content observers, when installed on
 content://contacts/people, are invoked fine when I add a new contact,
 so I know I'm using the right API and use it correctly.

 Any clues? Anyone has any examples of listening on these content
 providers? Or listening on different content providers which do give
 you information about sent SMS?

 Thanks.

 Denis
 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Content observers for SMS mailboxes

2008-10-23 Thread denismo

Thanks, you saved me time looking through the source code, I planned
to do this tonight.

Will try listening on those available URIs, and check for new sent SMS
as you suggested.

Thanks.

Denis

On Oct 24, 11:49 am, Evan JIANG [EMAIL PROTECTED] wrote:
 The sms provider's source code is in
 ROOT_OF_ANDROID_SOURCE_CODE/packages/providers/TelephonyProvider/SmsProvider.java
 After had a look at that, I found you're right. It only send UriChange
 notification on 3 Uris. I'm not sure if it's a bug.
 You can register your content observer on content://sms. After get the
 notifyChange, query the latest SMSes, and check the sent flag to judge is it
 a sent sms or received sms.

 Regards,
 Evan JIANG

 On Fri, Oct 24, 2008 at 8:22 AM, denismo [EMAIL PROTECTED] wrote:

  Hi,

  I've spent several days trying to figure out how to listen for sent
  SMS. One thing that I tried is content observers on content://sms/sent.
  That didn't work.  Then I tried content://sms/inbox. That didn't work
  either.

  In my scenarios, I was doing two things:
  - sending SMS to emulator using telnet sms send some number some
  text. This generates notification in the notification area, and you
  can read the sms later, but content observer on content://sms/inbox is
  not invoked
  - sending SMS from one emulator to another. I had one on 5554, another
  on 5556. I had content observers on both on content://sms/inbox and
  content://sms/sent and I was sending sms from 5554 to 5556 using
  sendTextMessage(5556, null, ...). I saw SMS being received by 5556,
  there was notification and I could read the SMS on 5556. None of the
  observers were invoked.

  So now I start wondering if content observers are at all support for
  SMS content provider?  The same content observers, when installed on
  content://contacts/people, are invoked fine when I add a new contact,
  so I know I'm using the right API and use it correctly.

  Any clues? Anyone has any examples of listening on these content
  providers? Or listening on different content providers which do give
  you information about sent SMS?

  Thanks.

  Denis


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---