I didn't try this in Java , but I have an old sample to exaplin the concept:
Originally Posted by manoj_2580
This is written in Delphi:
There must be a serial port component in Java and the code would look similar.
ComPort1.Writestr('ATZ'+chr(13)); // reset device
ComPort1.Writestr('AT+CMGF=1'+chr(13)); // operate in SMS text mode.
ComPort1.Writestr(mesaj + chr(26)); // character with ascii code 26
The reason why I put a delay there is because it takes a while to execute the command , normally this is not the correct way to do it but it works.
The best way to do it is to have a handler , that reads the data received from the mobile phone.
When you send ATZ you have to wait to receive an OK and only after that send the next instruction AT+CMGF=1 , and so on...
Try just to send an SMS for now, and then try to implement the receive SMS feature.
If you try to code it in C sharp I could help you faster with concrete sample code , I am currently working on something very similar in C sharp.
All the best,