wood burning stoves 2.0*
The moose likes Java Micro Edition and the fly likes Sending SMS from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Sending SMS from Java" Watch "Sending SMS from Java" New topic

Sending SMS from Java

fedai gandjaliyev
Ranch Hand

Joined: Dec 05, 2005
Posts: 99
I am aware that there is a Java API for sending SMS messages
from a PC onto a mobile phone.
But I dont know anything about the working environment.
Maybe some services must be installed on the PC for it to
work or the API does all that itself.
If a working environment must be set could you please forward
me to a page that describes in detail how to do it?
Mihai Lihatchi
Ranch Hand

Joined: Oct 28, 2005
Posts: 138

From my experience you need to have a contract with a SMS service provider. I used some API from Nokia (forum.nokia.com) for sending MMS messages through a server they own.

Better, faster, lighter Java ... you mean Ruby right ?
SCEA5,SCBCD1.3,SCWCD5,SCJP1.4 - memories from my youth.
fedai gandjaliyev
Ranch Hand

Joined: Dec 05, 2005
Posts: 99
What if I do it through an SMTP server?
What gateway do I need to connect to the server so that it can send
SMS messages to mobile phones?
fedai gandjaliyev
Ranch Hand

Joined: Dec 05, 2005
Posts: 99
Did I say something wrong?
I just asked a question.
It's already been a week that no one wants to answer my question.
I want to send SMS messages from Java through a mobile phone
connected to my PC.
What tools do I need?
A phone. What kind of phone would you advise?
An API. javax.comm.* or something else?
What exactly?
Please Help!
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41150
no one wants to answer my question

I'd be careful before drawing that conclusion. Maybe nobody can answer your question. Googling for "java sms" brings up lots of pages that look like they have relevant information.
[ February 28, 2006: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Eduardo Marques
Ranch Hand

Joined: Feb 19, 2005
Posts: 231
The standard API for SMS/CBS messaging on J2ME devices is the Wireless Messaging API - WMA 1.1 (JSR-120) or WMA 2.0 (JSR-205)

WMA 1.1 - covers SMS and CBS -http://jcp.org/en/jsr/detail?id=120
WMA 2.0 - also covers MMS - http://jcp.org/en/jsr/detail?id=205

Be sure to check your target device supports WMA. A list of some device capabilities can be found at:

There are several tutorials and technical articles about WMA, check Sun's site:


Eduardo Marques
Get ready for your SCMAD certification at J2MECertificate.com - See what all the buzz is about ...
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
The first thing you need to do is find a SMS gateway service provider. The service providers provide the gateway between the internet and the SMS network.

Most service providers provide a number of mechanism for generating SMS to name a few HTTP, FTP, XML-RPC, SMTP.

If your specifically interested in Java libraries you can try


If it is critial for you to determine if a SMS message has been sent, I would advise not using SMTP, as it's difficult to get the return code.


fedai gandjaliyev
Ranch Hand

Joined: Dec 05, 2005
Posts: 99
As I understand if you send SMS from Java through a phone connected
to PC then you dont need any third-party tool.
My problem is I'm going to purchase a mobile phone to begin developing
it but I dont know which one to purchase exactly.

I just need to know if this
1. Mobile phone
2. Cable to connect it to USB
3. javax.comm.* package installed
4. A Java API to communicate with the phone
is enough to do what I want to?
If the API is jSMS will any Nokia or Erricson do?
If not which Nokia model exactly will support it?
Waiting for reply.......
Thank you very much!
Eduardo Marques
Ranch Hand

Joined: Feb 19, 2005
Posts: 231
Oh sorry I misread this thread ... you want to send from PC to mobile phone ... in terms of SMS gateways check http://kannel.org (opensource) or http://nowsms.org (commercial)
[ March 01, 2006: Message edited by: Eduardo Marques ]
Ramesh Chandra

Joined: Oct 20, 2005
Posts: 17
hi fedai,
u can tryout the simplewire protocol for sending SMS from java.
Just download the SDK and u will have some samples for executing
u can reach there at www.simplewire.com

Ramesh Chandra
fedai gandjaliyev
Ranch Hand

Joined: Dec 05, 2005
Posts: 99
I'm developing a project a part of which sending SMS messages from Java.
I've attached a phone to my PC and can send messages quite comfortably.
The API that I use is jSMS 2-1-2.
To send a message you just need this part of code

service = new GsmSmsService();
Message msg = new Message();
//Connecting to the device

I'm going to send from 25 to 30 messages each time a use this project.
My question is do I need to create a new message (and/or service)
for each receipent or I need just do smth like this

for(int i=0; i<receipents.length; i++){
(For performance purposes only?)
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
Can you provide me the link/url from where you have downloaded the API for jSMS 2-1-2?

I am not able to locate the same using Google.


Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
I tried this link but it doesnt provide me a link to the API.



I agree. Here's the link: http://aspose.com/file-tools
subject: Sending SMS from Java
Similar Threads
SMS using java
Any Way To Send SMS through Java
requirement for development of j2me application
Sending SMS to mobile phones from a java prog
Library works with WindowsMobile SMS Box