views:

545

answers:

6

Hi,

I'd like to be able to read the system's SMS content provider. Basically I wanted to make an SMS messaging app, but it would only be useful if I could see past threads etc.

It seems like there's a content provider for this, but I can't find documentation for it - anyone know where that is?

Thanks

-------- edit -----------

Ok I found a way to get the sms inbox provider, and I just dumped all the column names in that provider, looks like this:

Uri uriSms = Uri.parse("content://sms/inbox");
Cursor c = context.getContentResolver().query(uriSms, null,null,null,null); 

// column names for above provider:
0: _id
1: thread_id
2: address
3: person
4: date
5: protocol
6: read   
7: status
8: type
9: reply_path_present
10: subject
11: body
12: service_center
13: locked

I'm just piecing this together from random threads I find around the net, I'm really wondering where this is all documented (if at all)?

Thanks again

+1  A: 

I guess what you are looking for is the SmsManager ( located in the android.telephony package ). It's capable of sending messages, so basically it should serve your needs.

moritz
Hi moritz, I'm really wondering about the content providers (edited question above to show that) - I don't know where to look for real documentation on the sms content provider?
Mark
A: 

The SMS content provider is undocumented for a reason -- it is not part of the SDK at this time. Please do not use it.

CommonsWare
Ah ok I thought it was legit since some apps like Handcent (> 250,000 downloads) are using it. I read your linked article. Yeah I don't really want to get into using undocumented APIs, shame that they haven't stabilized it yet, really cool features in there. Thanks.
Mark
I absolutely agree with the point made in the article but I think 'reaching beyond the SDK' is perfectly acceptable in some cases, e.g. in my personal SMS backup app that will never be used by anyone else
Josef
+1  A: 

Unfortunately the content provider for Sms and Mms (android.providers.Telephony) is not part of the public API at this moment. Until it is, you can define your own constants using this as a template.

Josef
A: 

[Not an Answer]

Olivier69
A: 

[Not an Answer]

salman
Please search for your question here and then post a NEW question if you can't find the answer.
colithium