How to send sms from my java appliction --__-- ??

How to send sms from my java appliction --__-- ?? SearchSearch
Author Message
Jl
New member
Username: Smsblur

Post Number: 1
Registered: 02-2004
Posted on Thursday, February 19, 2004 - 10:05 am:   

please help
i was asked to do project that can send a message to user mobile phone from my application? how does it done?

what component that i need?

csanchez
Unregistered guest
Posted on Thursday, February 19, 2004 - 02:31 pm:   

Yo will need any HTTP component you can find for Java, or a SMTP component.
Using HTTP component you just have to force a GET to the following URL:

http://127.0.0.1:8800/Send%20Text%20Message.htm?Phonenumber=nnnnnnnnnnnnn&Text=H ello%20World!!&PID=


Where nnnnnnnnn is the phone number and Text is a URL encoded string (you can find easiliy a URL Encode function looking for it on Google).
Jl
New member
Username: Smsblur

Post Number: 2
Registered: 02-2004
Posted on Friday, February 20, 2004 - 03:41 am:   

Thks for the reply !
Do i need to have any GSM modem or subscript to any mobile service provider? Currently, my application is java-based and not web-based.
What are the java and SMTP components required?
I am sorry for making a lot of questions coz i am quite new to mobile programming.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1921
Registered: 10-2002
Posted on Friday, February 20, 2004 - 11:53 pm:   

Jl,

This is the support forum for the Now SMS/MMS Gateway software product. Hence, csanchez' reply explains how you issue a request to the NowSMS gateway to tell it to send a message.

You can use NowSMS with a GSM modem, or with an SMS service provider.

The API for submitting messages to NowSMS is HTTP based. For generating the HTTP request from Java, you can either use the java.net.URLConnection class or one of the various HttpClient classes available for download from the internet. (I'm not a Java expert, but most people seem to prefer the HttpClient implementation from Apache.)
Jl
New member
Username: Smsblur

Post Number: 3
Registered: 02-2004
Posted on Tuesday, February 24, 2004 - 02:03 am:   

what modem would you recommend? cos i only use for sending messages only?

and do i need to install this gateway at my own comp?or is executes at the nowsms server?
VaibhavRajan
Unregistered guest
Posted on Thursday, February 26, 2004 - 06:14 am:   

the 2 way capability allows us to execute a program on receiving a message. is it possible to integrate the nowSMS gateway with a java application so that one or more SMS messages are sent by the application via the gateway? if so, please explain how it is done.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2003
Registered: 10-2002
Posted on Tuesday, March 09, 2004 - 05:31 pm:   


quote:

what modem would you recommend? cos i only use for sending messages only?




Some suggestions for phone as modem here:

http://support.nowsms.com/discus/messages/1/2783.html

Note that for the Nokia phones, I generally recommend any of the "Series 40" phones. (See www.forum.nokia.com to determine whether a particular Nokia model is "Series 40" or not.)

Recommended dedicated GSM modem devices include the Siemens MC35T (External device), and the Sierra Wireless Aircard 750 (PC Card).


quote:

and do i need to install this gateway at my own comp?or is executes at the nowsms server?




NowSMS is software that you install on a PC at your premises ... with either a connection to a GSM modem or an SMS service provider.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2004
Registered: 10-2002
Posted on Tuesday, March 09, 2004 - 05:34 pm:   


quote:

the 2 way capability allows us to execute a program on receiving a message. is it possible to integrate the nowSMS gateway with a java application so that one or more SMS messages are sent by the application via the gateway? if so, please explain how it is done.




I am not certain that I understand this question.

It sounds like you understand how NowSMS can receive a message and call your application, but you are unsure about sending.

From Java, you make an HTTP request to send a message through NowSMS. There is an example in the following thread using the Apache HttpClient component:

http://support.nowsms.com/discus/messages/485/1360.html

I hope that helps answer your question!

-bn
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2033
Registered: 10-2002
Posted on Tuesday, March 09, 2004 - 08:22 pm:   

Oops ... follow-up to last message. The Java example that I referenced was for sending MMS, which is a lot more complicated than SMS.

For SMS, you only need to connect and issue a simple HTTP GET request.
Steve
Unregistered guest
Posted on Wednesday, March 10, 2004 - 09:36 am:   

According o the examples in the nowsms documentation
this is the way to send a text message
"GET /?PhoneNumber=%2B35799482950&Text=abc+def+ghi HTTP/1.0"

the example on top here

http://127.0.0.1:8800/Send%20Text%20Message.htm?Phonenumber=nnnnnnnnnnnnn&Text=H ello%20World!!&PID=

adds Send%20Text%20Message.htm

which is the correct way?

Additionally i liked to know if you connect to nowsms programmatically and send a message do you receive any specific error codes (like a missing parameter )if something is wrong?

Thanks
Steve


Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2054
Registered: 10-2002
Posted on Wednesday, March 10, 2004 - 01:43 pm:   

Hi Steve,

If there is anything in the URL after the host name, and before the "?" parameter delimiter, it will be ignored.

So this "Send%20Text%20Message" is definitely ignored.

The reason that you see it in some examples, is that one of the good ways to better understand the URL encoding is to look at the URLs that are generated by our web forms.

One of our web forms is "Send%20Text%20Message.htm" ... and when you submit from that web form, the submission keeps the name of the form in the URL that is generated.

If you're ever able to do something that you want to do via one of the web forms, but can't figure out how to generate the URL request yourself directly ... enable the debug log in NowSMS. This is done by manually editing SMSGW.INI, and under the [SMSGW] section header, add Debug=Yes. Then restart the service. Submit your message from the form, and if you look at the SMSDEBUG.LOG, you'll be able to see the URL request that was generated when the form was submitted.

An HTTP level error code (other than "200 OK") is returned when a parameter is invalid, or an account is over quota, or there was some other problem. See http://support.nowsms.com/discus/messages/1/3229.html.

-bn
Maxim Khukhro
New member
Username: Maxim_kh

Post Number: 1
Registered: 04-2004
Posted on Wednesday, April 28, 2004 - 08:33 am:   

Hi!

Take a look at
SMProLib tool - sending SMS via Java. You also can receive messages.
http://mobiles.unipro.ru/smlib_eng.html
This can help you