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. pls send me the brief description about jdbc conne
View Tutorial          By: vikas at 2011-08-09 07:07:53

2. It would he helpful to know difference between a l
View Tutorial          By: Tosh at 2012-04-28 18:00:20

3. any one can send serial port communication using n
View Tutorial          By: prakash at 2013-07-01 15:44:48

4. Please give me a example of regionMatches().
View Tutorial          By: A. K. M. Saleh Sultan at 2009-10-05 14:52:25

5. hi,
How to create certificate from https://

View Tutorial          By: CN Balu Ramesh at 2011-07-19 08:38:31

6. short and simple program
hel

View Tutorial          By: sourabh agrawal at 2012-10-16 04:55:27

7. Precise information in the article, however it wou
View Tutorial          By: Ketan at 2009-06-23 05:07:39

8. i am run this code changing the SMSC (ex:+9198860
View Tutorial          By: sknand13 at 2007-11-16 03:27:52

9. nice information, thanks dost.
View Tutorial          By: Bhargavi Menpara at 2013-02-12 08:11:23

10. it's very good example to understands overloading
View Tutorial          By: Rakesh Sharma at 2011-11-18 06:37:49