Reading SMS messages

sconlon

Active Member
Licensed User
Longtime User
Hi,

I am developing an app that will receive incoming SMS messages, store them in an SQLlite database, display certain parts of them and allow the user to do things with them, such as reply or print to a bluetooth printer.

Since the app may be started (or restarted) after some appropriate messages have already been received I can't just use SmsInterceptor, so I am using SmsMessages.GetAllSince to receive those (within an activity module). I'm now wondering whether it is best to continue using SmsMessages.GetAllSince with a timer either in the same activity module or start a service module and use SmsInterceptor. It's important that the app gets the messages almost as soon as they are received so either the timer or the interceptor would need to run every few seconds.

Any advice on which is the best approach?

Ta.
 

sconlon

Active Member
Licensed User
Longtime User
Sorry about last post in the wrong thread, my mistake.

Anyway, attached is my (trimmed down) project file with the S1 module which produces the java error: "java.lang.Exception: Sub service_create signature does not match expected signature." when a SMS message is received.

Thanks again for any help.
 
Upvote 0

sconlon

Active Member
Licensed User
Longtime User
I am right in assuming that if the program is not running when a message is received it is only the appropriate service module that is created/started? If this is the case and the main module is not started then the service module cannot refer to any objects in the main or other modules. Or am I wrong again in this assumption?
 
Upvote 0

cmweb

Active Member
Licensed User
Longtime User
I am right in assuming that if the program is not running when a message is received it is only the appropriate service module that is created/started? If this is the case and the main module is not started then the service module cannot refer to any objects in the main or other modules. Or am I wrong again in this assumption?

that's correct.

Best regards,

Carsten
 
Upvote 0

sconlon

Active Member
Licensed User
Longtime User
Another question. Is it possible to get the time the message was received? I need to be able to identify each message uniquely and it seems to me that one way to do this is by the received time.

I can seem to find any list of other reflector methods except the ones that Erel has in his tutorial, i.e. getMessageBody and getOriginatingAddress.

Thanks.
 
Upvote 0

sconlon

Active Member
Licensed User
Longtime User
I also wonder if there is a way for the service to stop the message getting to the normal sms messaging system as this would be another way of ensuring that the program would not process the message again.
 
Upvote 0
Top