I am programming a sms desktop app with java using smslib, my program needs to store sms in a database table, then compare the sms with another table, and finally return a new sms, how to implement this process, with threads?? timers? I need to keep the app running all the day, the program just need to compare numbers with another table and then return the ones that are different, I have the app but in parts, I just want to know your approach, the user needs to receive a sms with the new numbers thanks
p.d I use smslib and the classes readmessages and sendmessages. I am stucked in this part, I dont want that my program crashes
SMSLib has 2 ways to receive messages.
Service.readMessages(). This requires implementing some kind of scheduling. For example your own thread or timer task.Due to sending messages may take some time (sometimes several seconds) you should do this asynchronously. Moreover the sending might fail, so you probably will have to implement retry mechanism. So, use queueing. The simplest way is to use Executors framework from java.concurrency package.