Is it possible to intercept received SMS from Android in Delphi XE5 as per this java code How to read the incoming message using service in background in android?.
Unfortunately there is no way to get Java events in delphi unless embarcadero specifically coded those events.
You can call pretty much any function or method in any class through various means but not events. Therefore you can't get the onReceive event of the broadcast receiver. The java class cannot be inherited from so you cannot override the event.
Best other option available would be to poll to check for messages but Delphi XE5 android apps can't be made into services yet..
If polling works for your needs you can follow this link: Reading text from SMS, and show it as text view
The Delphi equivalent of some of those calls:
cursor: JCursor;
uri: Jnet_Uri;
cursor := SharedActivity.getContentResolver.query(ENTER URL HERE, nil, nil,nil,nil);
while (cursor.moveToNext) do
// processing
Here is some Delphi code for reading data from the SMS inbox:
http://delphi-android.blogspot.dk/2013/10/how-to-fetch-sms-messages-from-android.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With