Android 1.5: Reading SMS messages

前端 未结 2 1435
天命终不由人
天命终不由人 2020-11-28 10:25

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?

相关标签:
2条回答
  • 2020-11-28 10:59

    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.

    0 讨论(0)
  • 2020-11-28 11:00

    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.

    0 讨论(0)
提交回复
热议问题