| | |
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.
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
•
•
Join Date: Jul 2006
Posts: 1
Reputation:
Solved Threads: 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.
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.
•
•
•
•
Originally Posted by usama
Hi All
How i can send SMS by Java Mobile Application.
I want the Class which used.
Thanx
Osama
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..
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..
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");
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");
All that for a three year dead thread?
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
Similar Threads
- how to send sms from web site to mobile (PHP)
- Java app to send an SMS via DKU-5 serial cable (Java)
- Send SMS with ASP.NET Webform, (Codebehind VB.NET) (ASP.NET)
- How to send sms from computer to mobile phone? (C++)
- send sms from pc to mobile in vb.net (VB.NET)
- send a sms when a new email arrives (ASP)
Other Threads in the Java Forum
- Previous Thread: java connectivity
- Next Thread: HTTP GET and POST REQUEST
| Thread Tools | Search this Thread |
6 @param actuate android api applet application arc array arrays automation balls binary bluetooth bold business byte c++ chat class client code codesnippet collections compare component coordinates database defaultmethod detection doctype dragging ebook eclipse educational error file fractal froglogic game givemetehcodez graphics gui guitesting helpwithhomework hql html ide ideas image ingres input integer internet intersect invokingapacheantprogrammatically j2me java javaexcel javaprojects jni jpanel jtextarea julia linux list map method methods mobile mysql netbeans newbie nextline parameter php pong problem program programming project recursion recursive scanner sell server set sms sort sql string sun swing swt terminal threads tree web websites windows






