Solved

Sending sms through java programming and j2me

Posted on 2006-06-18
7
461 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 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:Mayank S
Mayank S 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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 learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

733 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