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. This tutorial is very good. Actually I have been s
View Tutorial          By: farhaan at 2008-03-20 15:22:13

2. please give example code with defined variable.
View Tutorial          By: shajjad at 2011-02-13 20:56:09

3. Just what I was looking for. Thank you.
View Tutorial          By: Babool at 2008-05-08 08:32:50

4. Hi! Ramlak It Working But Sms didnot send why? and
View Tutorial          By: balaji at 2008-01-28 02:41:47

5. i have a question..i need to parse an xml file wit
View Tutorial          By: meltd0wn at 2011-09-30 08:36:51

6. I have download that 5 files .But how to run this
View Tutorial          By: Unnati at 2011-07-07 06:07:26

7. hi, would you please send me the detail to impleme
View Tutorial          By: nayeem at 2009-03-13 08:47:27

8. I have a website and i want to make a option to se
View Tutorial          By: rasel at 2011-11-26 15:50:49

9. You are good work ,an axplane is so gread

View Tutorial          By: chetan at 2009-06-08 11:58:51

10. Thanks,
But i would like to use an array li

View Tutorial          By: Gustavo at 2011-06-15 21:03:20