Need Java API to read message from Mobile and Send message to Mobile

I need to build application which can read the sms from mobile whenever new sms come and can send back response automatically to sender .
I saw smslib but could not get successes . It is giving me error "org.smslib.TimeoutException: No response from device" . I have tried this with mobile -samsung corby text-B3210 model.
Please provide me any running example or code or any other useful API. It will be very helpful for me