0

Hi All

How i can send SMS by Java Mobile Application.
I want the Class which used.
Thanx

Osama

5
Contributors
5
Replies
7
Views
11 Years
Discussion Span
Last Post by masijade
0

SMS triggered bombs? And asking others to write the software for them?
What'll Al Qaeda think up next...

There are a great many SMS libraries out there for you to purchase (and some may even have a limited functionality free version).
As you obviously didn't even bother researching the subject or you'd have found those yourself you should first do that.

0

hi
try it with this peace of code

 MessageConnection smsconn = null;
 smsconn = (MessageConnection) Connector.open(address);       String address = "sms://" + phoneNumberField.getString() + ":50000";     // address for sending sms "sms://phno:portno"
        MessageConnection smsconn = null;
        try {
            smsconn = (MessageConnection) Connector.open(address);

            TextMessage txtmessage = (TextMessage)smsconn.newMessage(MessageConnection.TEXT_MESSAGE);
            txtmessage.setAddress(address);
            txtmessage.setPayloadText(messageField.getString());
            smsconn.send(txtmessage);

thanks and regards
thiyagu.

Hi All

How i can send SMS by Java Mobile Application.
I want the Class which used.
Thanx

Osama

Edited by Reverend Jim: Fixed formatting

0

Hi jwenting,
Always you are scolding the forum senders. what you think about you man. See if you know the solution for the query, just send it otherwise shut your mouth. Don't give false replies.
otherwise show a good way to solve the problem by themselves.

Don't take it as advice its a humble request.


Share the knowledge don't show your anger...

Hidash..

-1
String phone="123456789";
String message="Hello India,";
String ppgHost= "http://localhost:portno";
try
{
phone=URLEncoder.encode(getMobileId(), "UTF-8");
if(debug)
System.out.println("phone---->"+phone);
message=URLEncoder.encode(getMessage(), "UTF-8");
if(debug)
System.out.println("message---->"+message);
}
catch (UnsupportedEncodingException e)
{
System.out.println("Encoding not supported");
}
String url_str=ppgHost+"?PhoneNumber="+phone+"&Text="+message;


System.out.println("path name---url_str----->\n\n"+url_str);
URL url2=new URL(url_str);
HttpURLConnection connection = (HttpURLConnection) url2.openConnection();
connection.setDoOutput(false);
connection.setDoInput(true);
if(debug)
System.out.println("connection :"+connection);
String res=connection.getResponseMessage();
if(debug)
System.out.println("res :"+res);


int code = connection.getResponseCode () ;
if ( code == HttpURLConnection.HTTP_OK )
{


connection.disconnect() ;


}
System.out.println("Message Sent Successfully");

Edited by happygeek: fixed formatting

Votes + Comments
Useless solution for a dead thread and no code tags even after 83 posts
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.