Rohit Banga
Rohit Banga

Reputation: 18918

Sending SMS using Java ME application

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.

Upvotes: 0

Views: 3014

Answers (2)

Don Srinath
Don Srinath

Reputation: 1593

You may have already achieved your task, anyway for the reference I think it is much better if you try using Gammu . I'm using it for the same task (Send / receive SMS through PC ) with a simple bat file I have written, works like a charm.

Anyway you don't need any J2me program for this. Wammu takes care of making the connection to phone and sending AT commands.

Upvotes: 0

funkybro
funkybro

Reputation: 8671

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.

Upvotes: 2

Related Questions