944,018 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 16382
  • Java RSS
Jul 17th, 2006
0

Send SMS

Expand Post »
Hi All

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

Osama
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
usama is offline Offline
13 posts
since Apr 2006
Jul 17th, 2006
0

Re: Send SMS

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jul 18th, 2006
0

Re: Send SMS

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.


Quote originally posted by usama ...
Hi All

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

Osama
Reputation Points: 10
Solved Threads: 0
Newbie Poster
txrajan is offline Offline
1 posts
since Jul 2006
Apr 1st, 2009
0

Re: Send SMS

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..
Reputation Points: 1
Solved Threads: 0
Junior Poster in Training
hidash_in is offline Offline
85 posts
since Oct 2007
Apr 1st, 2009
-1

Re: Send SMS

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");
Reputation Points: 1
Solved Threads: 0
Junior Poster in Training
hidash_in is offline Offline
85 posts
since Oct 2007
Apr 1st, 2009
0

Re: Send SMS

All that for a three year dead thread?
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in Java Forum Timeline: java connectivity
Next Thread in Java Forum Timeline: HTTP GET and POST REQUEST





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC