This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to wait for messages alert Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to wait for messages alert" Watch "How to wait for messages alert" New topic
Author

How to wait for messages alert

Jas Oberai
Ranch Hand

Joined: Jan 16, 2005
Posts: 231
Hi Friends,
I have a java web application.I want to automate it.Right now,when I click the "submit button",my appln reads messages from the phone sim card(attached to my pc),queries the database and then automatically sends a response back to the originator.
How to automate this,such that my java program automatically knows that a new message has arrived on the phone and read that message and send the response back.
Please suggest some easy way.
Thanks


SCJP 1.4 (88%)<br />SCWCD 1.4 (88%)
Ajay A Patil
Greenhorn

Joined: Apr 13, 2006
Posts: 22
You might have to keep polling the phone to check for new messages.
See java.util.Timer class on how to execute your program after
every 'n' minutes.
Jas Oberai
Ranch Hand

Joined: Jan 16, 2005
Posts: 231
That was one way,I was thinking.But isn't there any way to listen to some port or something that notifies you when a new message arrives...thanks a lot.
Jas Oberai
Ranch Hand

Joined: Jan 16, 2005
Posts: 231
Hi,
I wrote this class to run every 5 seconds but it executes only once,can someone please tell me where i am going wrong

Thanks
Ajay A Patil
Greenhorn

Joined: Apr 13, 2006
Posts: 22
Remove this line.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to wait for messages alert
 
Similar Threads
JMS - Message Selector usage
how to automate a java program
j2me app not working on device
make servlet continually refresh page
testing midlet with real phone