开发者

Android - Get all sms in phone sent to a peson

I'm new to android programming. just to improve my skills, i started with some project in my mind. when app starts, it will show a b开发者_Go百科utton. on click of it, it will allow me to select a contact from the address book. then i want to retrieve all the sms sent to that contact (if they are stored in sms outbox). Is it possible. Can some one guide me. If there is some tutorial on these topics, can you let me know the URL or source code? Thanks in Advance.


First, it is not possible. There are many SMS clients for Android, many of whom do not expose an "sms outbox".

Second, even if you limit yourself to the SMS application that ships with "Google Experience" phones, the "sms outbox" is not part of the SDK.

If you wish to create an application that sends SMS messages, there is the SmsManager class you can use.


As folks mentioned, the sms outbox is undocument. If you want to access it, you sholud have some skills first.

  • trace android source code
  • learn how to use content provider (learn how to create a content provider is better)
    • what's the authority
    • know does the URI matched
    • how to manipulate the Cursor
  • write some sample code to test

You can find the SMS/MMS content provider here:
https://android.googlesource.com/platform/packages/providers/TelephonyProvider

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜