Android SMS programming

I want to find a specific SMS method that contains a specific word and automatically reply.

I found a way to reply to SMS, but I still cannot work on finding SMS ...

+3
source share
4 answers

It’s true that it wasn’t documented, but people used it for many years, and if the update was to change the way the SMS database was accessed, it would affect hundreds of users. Therefore, I doubt that they will change this soon.

, SMS where. , . - , . : SMS ?

SMS .

Cursor messages; 
    Columns message = ColumnsFactory.messages(); //points to structutre
    messages = getContentResolver().query(Uri.parse("content://sms/"),
            null, null, null, null);



    while (messages.moveToNext()) {
    //do stuff here.
+2

Google App Inventor? .

-

+1

SMS SMS. SMS , . .

:

if (smsBody.contentEquals("word to match")) {
   // create reply
}
+1
source

There is an undocumented content provider for SMS: "content: // sms / inbox". But this is not official and may change. There is no proper way to access sms.

0
source

Source: https://habr.com/ru/post/1778964/


All Articles