开发者

Sending SMS using Java ME application

开发者 https://www.devze.com 2022-12-30 06:44 出处:网络
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

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 t开发者_Go百科o 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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号