Im trying to write an app that performs an action when the phone receives an SMS with a specific command text.
Ive got the background service running fine and the SMS is picked up correctly. Im got it logging to a file as well so I can confirm everything is happening. The phone is permanently in a dock so is powered but maybe "sleeping". I've disabled any wifi sleep & power saving options.
The problem Im having is that the the action the phone takes (sending a UDP packet over the wifi connection) is sporadically successful.
Im not sure if what Im doing it right.
1) Service intercepts SMS
2) Message is parsed and added to "stack" of commands
3) Timer enabled
4) For each timer tick check device has an WiFi IP and sends the command
5) If no more messages stop the timer
I note that the timer runs on the UI thread, is this a problem for service modules?
My log file indicates everything is working but I'm seeing odd results in the real world.