[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Sending sms through java programming and j2me

Posted on 2006-06-18
7
Medium Priority
?
491 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 6

Accepted Solution

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

Assisted Solution

by:Kanti
Kanti earned 100 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 100 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:Mayank S
Mayank S earned 100 total points
ID: 16933582
0
 
LVL 2

Assisted Solution

by:RoyalNepal
RoyalNepal earned 100 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video teaches viewers about errors in exception handling.
Suggested Courses

649 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