
04-02-2008, 10:55 AM
|
|
Member
|
|
Join Date: Mar 2008
Posts: 2
Rep Power: 0
|
|
java code for send sms through http
java code for send sms through http
|
|

04-02-2008, 01:00 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
|
|
|
Yes it is, in Google is one of the best solution to find the such details. Can find lots of resources there.
|
|

11-27-2008, 05:46 PM
|
|
Member
|
|
Join Date: Nov 2008
Posts: 1
Rep Power: 0
|
|
Prasad
Hi I am new to this forum.i need help sendins sms fax/email actions using java Application.Pls suggest me.
Thanks,Prasad
|
|

11-28-2008, 05:10 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
|
|
Originally Posted by prasaddasari
|
Hi I am new to this forum.i need help sendins sms fax/email actions using java Application.Pls suggest me.
Thanks,Prasad
|
You should try to workout first lol. In the first replay on this thread you can see few links, did you read them? Once you goo through all pf them, can have a clear idea about that.
|
|

12-27-2008, 01:46 PM
|
|
Member
|
|
Join Date: Dec 2008
Posts: 1
Rep Power: 0
|
|
|
tanx for giving d stuff
|
|

01-01-2009, 03:58 AM
|
|
Member
|
|
Join Date: Jan 2009
Posts: 2
Rep Power: 0
|
|
Send and Recevie SMS using Java
Hi,
Here is a sample code in Java for sending and receiving SMS:-
|
Code:
|
package javaSMS;
import com.jacob.activeX.*;
import com.jacob.com.*;
public class javaSMSTest {
//extract "return value" as boolean, integer and assign to these variables:-
private static boolean bSMS;
private static int iSMS;
/**
* @param args
*/
public static void main(String[] args) {
//construct an object -- "SMSAPIJava", a Java wrapper for SMS class in "MobitekSMSAPI5.dll"
ActiveXComponent SMSAPIJava = new ActiveXComponent ("MobitekSMSAPI5.SMS");
//&&&&&&&&&& connect GSM modem to computer &&&&&&&&&&&&&&&&&&
//call API to connect GSM modem to computer at COM port no. 2
//the return value of the API call is assigned to "SMSAPIReturnValue"
Variant SMSAPIReturnValue = SMSAPIJava.invoke("ModemInit", 2);
//since the return value of function "ModemInit" is an integer, so extract the return value as an integer and assign to "iSMS"
iSMS = SMSAPIReturnValue.getInt();
switch (iSMS)
{
case 0 : System.out.println("GSM modem is NOT connected to computer!"); return;
case 1 : System.out.println("GSM modem is connected to computer."); break;
case 2 : System.out.println("GSM modem is NOT connected to computer because a PIN is required!"); return;
case 3 : System.out.println("GSM modem is NOT connected to computer because wrong PIN is entered!"); return;
case 4 : System.out.println("GSM modem is NOT connected to computer because SIM card is blocked by network operator!"); return;
case 5 : System.out.println("GSM modem is NOT connected to computer because SIM card has problem!"); return;
}
//&&&&&&&&&& end: connect GSM modem to computer &&&&&&&&&&&&&&&&&&
//!!!!!!!!!! check connection between GSM modem and GSM network !!!!!!!!!!!!!!!!!!!!!!!!
//call API to check connection with GSM network, the return value of the API call is assigned to "SMSAPIReturnValue"
SMSAPIReturnValue = SMSAPIJava.invoke("ConnectToGSM");
//since the return value of "ConnectToGSM" is a boolean, so extract the return value as a boolean and assign to "bSMS"
bSMS = SMSAPIReturnValue.getBoolean();
if (bSMS)
{
System.out.println("GSM modem is connected to GSM network.");
}
else
{
System.out.println("GSM modem is NOT connected to GSM network!");
}
//!!!!!!!!!! end: check connection between GSM modem and GSM network !!!!!!!!!!!!!!!!!!!!!!!!
//~~~~~~~~~~~~~~~~ check signal strength of GSM network ~~~~~~~~~~~~~~~~~~~~~~~
//call API to check signal strength of GSM network, the return value of the API call is assigned to "SMSAPIReturnValue"
SMSAPIReturnValue = SMSAPIJava.invoke("GetSignalStrength");
//since the return value of "GetSignalStrength" is an integer, so extract the return value as an integer and assign to "iSMS"
iSMS = SMSAPIReturnValue.getInt();
switch (iSMS)
{
case -1 : System.out.println("Unable to get signal strength!"); break;
case 0 : System.out.println("NO signal strength!"); break;
case 1 : System.out.println("WEAK signal strength."); break;
case 2 : System.out.println("NORMAL signal strength."); break;
case 3 : System.out.println("STRONG signal strength."); break;
}
//~~~~~~~~~~~~~~~~ end: check signal strength of GSM networki ~~~~~~~~~~~~~~~~~~~~~~~
//########### turn delivery status report on #######################
//call API to turn delivery status report on
//the return value of the API call is assigned to "SMSAPIReturnValue"
SMSAPIReturnValue = SMSAPIJava.invoke("DeliveryReportOn");
//since the return value of "DeliveryReportOn" is a boolean, so extract the return value as a boolean and assign to "bSMS"
bSMS = SMSAPIReturnValue.getBoolean();
if (bSMS)
{
System.out.println("Delivery status report is turned on.");
}
else
{
System.out.println("Delivery status report is NOT turned on!");
}
//########### end: turn delivery status report on #######################
//------------------ send SMS ----------------------------------------
//set value of property; "ToNumber" is the recipient's number; "ToMessage" is the SMS to be send to the recipient
SMSAPIJava.setProperty("ToNumber", "0163311600");
SMSAPIJava.setProperty("ToMessage", "Hello from JAVA. Test DSR 6");
//call API to send out SMS, the return value of the API call is assigned to "SMSAPIReturnValue"
SMSAPIReturnValue = SMSAPIJava.invoke("SendSMS");
//since the return value of "SendSMS" is a boolean, so extract the return value as a boolean and assign to "bSMS"
bSMS = SMSAPIReturnValue.getBoolean();
if (bSMS)
{
System.out.println("Messange sent!");
//try 3 times
for (int i=1; i<=3; i++)
{
//call API to get delivery status report, the return value of the API call is assigned to "SMSAPIReturnValue"
SMSAPIReturnValue = SMSAPIJava.invoke("GetDeliveryReport");
//since the return value of "GetDeliveryStatusReport" is a boolean, so extract the return value as a boolean and assign to "bSMS"
bSMS = SMSAPIReturnValue.getBoolean();
if (bSMS)
{
//when "GetDeluveryStatusReport = True", then get value of properties
int DRStatus = SMSAPIJava.getPropertyAsInt("DRStatus");
String DRMNRecipient = SMSAPIJava.getPropertyAsString("DRMNRecipient");
String DRMsgRef = SMSAPIJava.getPropertyAsString("DRMsgRef");
String DRFDate = SMSAPIJava.getPropertyAsString("DRFDate");
String DRFTime = SMSAPIJava.getPropertyAsString("DRFTime");
String DRRDate = SMSAPIJava.getPropertyAsString("DRRDate");
String DRRTime = SMSAPIJava.getPropertyAsString("DRRTime");
if (DRStatus == 1)
{
//System.out.println("The status of your outgoing SMS with reference number, " + DRMsgRef + ", is " + DRStatus + ".");
System.out.println("The status of your outgoing SMS with reference number, " + DRMsgRef + ", is delivered.");
System.out.println("Your outgoing SMS was received by the SMS Centre on " + DRRDate + ", at " + DRRTime + ", and was successfully delivered to " + DRMNRecipient + ", on " + DRFDate + ", at " + DRFTime + ".");
}
else
if (DRStatus == 0)
{
//System.out.println("The status of your outgoing SMS with reference number, " + DRMsgRef + ", is " + DRStatus + ".");
System.out.println("The status of your outgoing SMS with reference number, " + DRMsgRef + ", is not delivered.");
System.out.println("Your outgoing SMS was received by the SMS Centre on " + DRRDate + ", at " + DRRTime + ", and was NOT successfully delivered to " + DRMNRecipient + ".");
}
else
if (DRStatus == 2)
{
//System.out.println("The status of your outgoing SMS with reference number, " + DRMsgRef + ", is " + DRStatus + ".");
System.out.println("The status of your outgoing SMS with reference number, " + DRMsgRef + ", is unknown.");
System.out.println("Your outgoing SMS was received by the SMS Centre on " + DRRDate + ", at " + DRRTime + ", and NO status is available.");
}
break;
}
else
{
System.out.println("No delivery status report available!");
}
}
}
else
{
System.out.println("Messange NOT sent!");
}
//------------------ end: send SMS ----------------------------------------
//+++++++++++++++++++++ read SMS ++++++++++++++++++++++++++
//call API to read incoming SMS, the return value of the API call is assigned to "SMSAPIReturnValue"
SMSAPIReturnValue = SMSAPIJava.invoke("ReadSMS");
//since the return value of "ReadSMS" is a boolean, so extract the return value as a boolean and assign to "bSMS"
bSMS = SMSAPIReturnValue.getBoolean();
//if there is new SMS, then get property
if (bSMS)
{
//property "MN" is the sender's number
String InNumber = SMSAPIJava.getPropertyAsString("MN");
//property "MSG" is the sender's message
String InMessage = SMSAPIJava.getPropertyAsString("MSG");
System.out.println("Number " + InNumber + ": " + InMessage );
}
else
{
System.out.println("No incoming SMS!");
}
//+++++++++++++++++++++ end: read SMS ++++++++++++++++++++++++++
//------- close connection between GSM modem and computer ---------------
//call API to close connection between GSM modem and computer, the return value of the API call is assigned to "SMSAPIReturnValue"
SMSAPIReturnValue = SMSAPIJava.invoke("ModemClose");
//since the return value of "ModemClose" is a boolean, so extract the return value as a boolean and assign to "bSMS"
bSMS = SMSAPIReturnValue.getBoolean();
if (bSMS) System.out.println("Connection between GSM modem and computer is closed." );
else System.out.println("Connection between GSM modem and computer CANNOT be closed!" );
}
//------- end: close connection between GSM modem and computer ---------------
} |
Source: mobitek.com.my/SMS_Gateway/SMS_API_Java/Index.htm
Hope it helps!
Happy coding!
Last edited by Helper; 01-01-2009 at 04:07 AM.
|
|

01-01-2009, 04:06 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
|
|
|
I think it's better if you can provide download link of that package, since it's not a standard one for JDK. People can get wired with it.
|
|

04-12-2009, 08:28 PM
|
|
Member
|
|
Join Date: Apr 2009
Posts: 1
Rep Power: 0
|
|
|
Hi hello this is sandeep.
|
|

04-13-2009, 01:19 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
|
|
Hello Sandeep, welcome to our community 
Please don't do this again, if your question is not related to the original of the thread don't post it there. Choose the best sub-forum and start a new thread. And also please read our FAQ page before posting again.
|
|

09-17-2009, 07:10 AM
|
|
Member
|
|
Join Date: Aug 2009
Posts: 66
Rep Power: 0
|
|
this code doesn't have Main..it fails to run
|
|

09-24-2009, 11:22 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
|
|
|
So why don't you implement a main method and give a try. I hope you are clear with the code.
|
|

09-28-2009, 11:53 PM
|
|
Member
|
|
Join Date: Sep 2009
Posts: 1
Rep Power: 0
|
|
casinomaster
People have been inventing something new for many centuries to improve the casino gambling online games (roulette (link-online roulette), blackjack (link-online blackjack), poker (link-online poker)), various casino buildings were constructed by the most popular designers and artists in order to create special atmosphere, which is attracted lots of gamblers and involved them to tempt their fate. The owners of the casino were real masters of their own businesses. They didn’t save money on an excellent environment creature in order to make their casino the most elite one that will gather the fans of excitement and a a good game. It should be noted that they managed to do that. Game is one of the human needs, which he tends to realize.
But what about now? Science stepped far forward, but people have the same needs. Anyway people want bread and circuses to feel happy. Therefore, the history of the game continues and results in casino online that is offered at various casino online websites.
To win money at online casino one can bet with virtual money. , store them on a demo account and win the same virtual money. Indeed casino online games tend to be more exciting and interesting. In order to play at online casino the user must register on the website, make the money deposit to his account and start playing. Playing at online casino is convenient when a player sees his own balance account, the bet sum and the game taking part against the visual opponent. Naturally, some players are afraid for their money and therefore they are very cautious. In vain! Cheats online casino sites today number a small number and their life existence is too low. Goof serious casino do all their best for the gambler convenience: the 24-hour support is working for every gambler while the instant cash transactions such as money withdrawal, extra cash replenishment and various types of bonuses are available
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 06:35 PM.
|
|