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. How can i update status 1 and 0 in RMS ?
an

View Tutorial          By: maaz at 2011-06-16 02:54:28

2. Splendid! Haven\'t used asserts before, very helpf
View Tutorial          By: Anonymous at 2009-03-11 04:18:42

3. Dear Sir,

This code is so good. but

View Tutorial          By: Jai Singh Saini at 2010-05-06 06:13:45

4. Hi Ramalak, I am suffering with the same error as
View Tutorial          By: Divya at 2008-11-06 22:46:12

5. A very good demonstration o Vector!!
View Tutorial          By: Pankaj Kumar Mishra at 2010-12-09 01:35:06

6. In the case of Basic validation is it must to spec
View Tutorial          By: Uma shankar at 2014-07-09 00:58:05

7. Hello Ramlak, I am too getting
java.lang.U

View Tutorial          By: Amruta at 2008-11-07 23:56:17

8. please send basic sample programs & explanatio
View Tutorial          By: rose at 2013-01-16 04:43:38

9. hi all m getting following error ,
can anyo

View Tutorial          By: raj at 2008-11-04 21:46:12

10. Thank uvery much :) u r so helpful
View Tutorial          By: Ahmed at 2011-12-04 10:01:11