Solved

Sending sms through java programming and j2me

Posted on 2006-06-18
7
447 Views
Last Modified: 2007-12-19
dear helper
i want to send the sms using java and also j2me .please help me in this regard and if you have tutorial for that or source code for that please provide me for learning purpos.


thanks
regards
softflux
0
Comment
Question by:softflux
7 Comments
 
LVL 6

Accepted Solution

by:
phuocnh earned 25 total points
ID: 16932820
I am using SMSLib http://smslib.org
Phuoc
0
 
LVL 3

Assisted Solution

by:Kanti
Kanti earned 25 total points
ID: 16933245
see http://www.dreamfabric.com/sms/

SMProLib tool - sending SMS via Java. You also can receive messages.
http://mobiles.unipro.ru/smlib_eng.html


You need a phone that supports Wireless Messaging API (WMA) as part of the J2ME implementation. Both WMA 1.1 and 2.0 are out.

You  can find some API's of few model of phones
 http://www.sms-gateway-software.com


This code is from a Motorola SDK document for WMA 2.0:


//To send SMS
try {
String addr = “sms://+358401234567”;
MessageConnection conn = (MessageConnection) Connector.open(addr);
TextMessage msg =
(TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
msg.setPayloadText(“Hello World!”);
conn.send(msg);
} catch (Exception e) {
...
}




//To receive SMS
try {
String addr = “sms://:5432”;
MessageConnection conn = (MessageConnection) Connector.open(addr);
Message msg = null;
while (someExitCondition) {
// wait for incoming messages
msg = conn.receive();
// received a message
if (msg instanceof TextMessage) {
TextMessage tmsg = (TextMessage)msg;
String receivedText = tmsg.getPayloadText();
// respond with the same text with “Received:”
// inserted in the beginning
tmsg.setPayloadText(“Received:” + receivedText);
// Note that the recipient address in the message is
// already correct as we are reusing the same object
conn.send(tmsg);
} else {
// Received message was not a text message, but e.g. binary
...
}
}
} catch (Exception e) {
...
}

0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 25 total points
ID: 16933269
An alternative solution to using a phone is to use an SMS server to send a message. It is actually *very easy* once you have access to the SMS server since they are several protocols you could use such as HTTP, WML, TCP/IP, SMTP and probably several others (it depends on the sms server vendor). Once you register with an SMS vendor they provide you with a username/password pair which you should use in all your requests to the server in order to identify them.

I have done it twice in the past and I have used clickatell: http://www.clickatell.com/ for this, very easy to use and very low prices (depends on the volume of SMS you want to send though).
0
 
LVL 30

Assisted Solution

by:mayankeagle
mayankeagle earned 25 total points
ID: 16933582
0
 
LVL 2

Assisted Solution

by:RoyalNepal
RoyalNepal earned 25 total points
ID: 16938413
Hey,
   Which Wireless Tool Kit do you have?????? If you have WTK 2.3 there is a project example for that. I think there is one in WTK 2.2 as well.
Go to src folder in that project and see the code.

Hope that helps.

Roy

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
array11 challenge 16 52
array220 challenge 8 48
mockito example issue 8 35
Java Jpanels and Jframe 8 20
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now