Comment on Tutorial - How to Send SMS using Java Program (full code sample included) By Emiley J.



Comment Added by : Ashish

Comment Added at : 2009-03-25 04:28:25

Comment on Tutorial : How to Send SMS using Java Program (full code sample included) By Emiley J.
Hi all this program is working very fine .... i had some doubts as i too have posted one query (199) .. but now i have resolved it and this program is working fine!!! ....thanx for such a good program!! ..

to all people who are having the problem of
javax.comm.NoSuchPortException
first check if ur COM port is really been detected by the driver ( as it was not in my case) ...thats the reason u'll get this problem!!! .. i'll give you one program that will display all the serial and parallel ports in ur system .. just check if ur port is there or not....

/* program*/

import javax.comm.*;
import java.util.Enumeration;

public class ListPorts {
public static void main(String args[]) {
Enumeration ports = CommPortIdentifier.getPortIdentifiers();
while (ports.hasMoreElements()) {
CommPortIdentifier port = (CommPortIdentifier)ports.nextElement();
String type;
switch (port.getPortType()) {
case CommPortIdentifier.PORT_PARALLEL:
type = "Parallel";
break;
case CommPortIdentifier.PORT_SERIAL:
type = "Serial";
break;
default: /// Shouldn't happen
type = "Unknown";
break;
}
System.out.println(port.getName() + ": " + type);
}
}
}

just check it ...
this is what the output will be!!( my case)

COM1: Serial
COM2: Serial
COM7: Serial
LPT1: Parallel
LPT2: Parallel
my port is COM7 .. so just check it !!!!

Regards ..... Ashish!!!


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. it is very useful and in understandable manner
View Tutorial          By: Deepika at 2012-03-26 05:10:15

2. Good and Simple Example For Beginners Like me.Than
View Tutorial          By: Lasantha Bandara at 2010-06-29 19:21:48

3. Hi,

i need a program to send sms wh

View Tutorial          By: Sindhuja at 2013-05-29 07:07:15

4. Thanks. A couple of typos, though:
- &quo

View Tutorial          By: Steve Parker at 2013-09-25 09:47:08

5. hi how ru
anybody tell me that how to print

View Tutorial          By: imran at 2010-12-10 00:34:51

6. Hi all, i have tried above code, but am getting fo
View Tutorial          By: shalini Iyer at 2008-04-22 01:20:32

7. very nice
View Tutorial          By: Md Irshad Alam at 2014-10-29 18:58:53

8. I had downloaded all 5 the file
but i need

View Tutorial          By: Dhananjay at 2009-12-09 10:20:30

9. Thank you! Solved many headaches :)
View Tutorial          By: Dominik at 2013-07-30 16:51:46

10. Simple file writer example. .............
<

View Tutorial          By: Chezhian TK at 2010-10-14 21:40:16