views:

51

answers:

1

I want to a Java ME application that transfers any SMS received to a PC using bluetooth. The PC can then direct the Java ME application via bluetooth to send a response SMS. Is there library available for this architecture or I have to design it myself? Is this approach correct or a better one exists? I want to use bluetooth as then I will not have dependency on the cable.

+1  A: 

You'll need to create this yourself, however you'll find that you can't do what you want with J2ME.

J2ME can't access any old SMS that the handset receives, only ones sent to a specific port upon which the MIDlet is listening. So to get all the other SMSes, create a bluetooth serial/dial-up connection to your handset in the way I've described in this answer.

Create a PC client which repeatedly issues AT+CGML commands (as described in the AT command set document linked to in the answer above), to see when an SMS has been received. Use AT+CGMR to read and parse the message text. Then use AT+CGMS to sent a response. This can all be done over bluetooth.

It's better to use the serial connection to send a response, because a MIDlet cannot usually be triggered to open based on incoming bluetooth data.

Hope this helps.

funkybro
ok now i understand. 1. could you tell me what software or libraries i need to install? 2. are there any code examples for this? 3. i have a samsung sg-e251. i don't think that matters. right?
iamrohitbanga
You just need to follow the instructions in the link above. I don't know whether the Samsung phones support all the necessary AT commands I'm afraid :-(
funkybro
OK I tried doing this using hyperterminal. It works. I would want to do it using a Java program.
iamrohitbanga
By creating the dial-up connection, you have opened a COM port to the handset from your PC; you need some way of talking over the COM port from the PC. Try reading about Javacomm. http://java.sun.com/products/javacomm/
funkybro
ok i will do that.
iamrohitbanga