views:

3148

answers:

2

I'm creating a backup utility for Android and I need to read content of inbox, outbox and dratfs. How can I accomplish that on SDK v1.5?

A: 

If you can open a connection to the internal modem and run AT commands (not sure how this is done), then you can backup in the following way (strip the comments):

AT+CSCS="UTF8"      // select character set
AT+CMEE=2           // turn on extended error reporting
AT+CPMS="ME","ME"   // select message storage in the phone
AT+CMGL=4           // read all messages
AT+CPMS="SM","SM"   // select message storage on SIM
AT+CMGL=4           // read all messages

You should of course wait for OK after issuing each of the commands. Refer to 27.005 and 27.007 for details of the commands.

hlovdal
+4  A: 

There is a content provider for accessing SMS messages, but it's not documented in the public SDK. If you use ContentResolver.query() with a Uri of content://sms you should be able to access these messages.

You can find more information on this Google Groups thread or previous questions on stackoverflow.

jargonjustin