How to read the message content of a new in coming message in android?

前端 未结 5 1194
深忆病人
深忆病人 2020-12-04 20:42

I want to read the message body of a new incoming SMS in android, programmatically.

I tried something but that doesn\'t return any contents:

5条回答
  •  情深已故
    2020-12-04 20:58

    A very easy solution would be to use this SMS Parser library:

    https://github.com/adorsys/sms-parser-android

    compile 'de.adorsys.android:smsparser:0.0.3'
    

    Using it you can either read the whole message, or specific parts of the incoming message. You can also set the phone numbers from which the message will be coming.

    If you need more info about how it works or its usage check the github repository I listed above.

提交回复
热议问题