Interception of received SMS in Delphi XE5 for Android

Is it possible to intercept received SMS from Android in Delphi XE5 in accordance with this java code How to read an incoming message using a service in the background in android? .

+6
source share
3 answers

Unfortunately, there is no way to get Java events in delphi unless embarcadero encoded these events.

You can call almost any function or method in any class using various means, but not events. Therefore, you cannot receive the onReceive event of the broadcast receiver. The java class cannot be inherited, so you cannot override the event.

The best other option available is polling to check messages, but Android apps for Delphi XE5 cannot yet be added to services.

If the survey works for your needs, you can follow this link: Read text from SMS and display it as a text view

The Delphic equivalent of some of these calls:

cursor: JCursor;

uri: Jnet_Uri;

cursor: = SharedActivity.getContentResolver.query (ENTER URL HERE, nil, nil, nil, nil);

while (cursor.moveToNext) do

//treatment

+4
source

Here are some Delphi codes for reading data from incoming SMS messages:

http://delphi-android.blogspot.dk/2013/10/how-to-fetch-sms-messages-from-android.html

+2
source

Yes! You can! My answer has an Android BroadcastReceiver example right here . Just change the code to receive SMS events, as in the article that you linked in your question.

0
source

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


All Articles