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



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. Its really good.....
View Tutorial          By: Shivam at 2009-04-02 03:58:51

2. Dear any buddy i use Nokia N73 and connect with Bl
View Tutorial          By: zstranger at 2012-03-29 07:43:12

3. please explain importance of java and explain it's
View Tutorial          By: sandhi.vijayanth reddy at 2012-10-01 16:30:54

4. It is very helpful, I searched in many websites, b
View Tutorial          By: Anil Vaja at 2013-10-14 17:21:42

5. Hi thanks for your information.

I g

View Tutorial          By: karthikeyan at 2009-09-18 04:50:37

6. it should be:
/* --------------- */

View Tutorial          By: Ryba at 2010-05-19 15:45:48

7. BIG Thanks for such wonderful tutorial :) :) :)
View Tutorial          By: dhruva at 2013-07-10 08:56:27

8. Doesn't the getline() on line 14 read "once u
View Tutorial          By: poo at 2011-02-22 00:32:44

9. thank you..!!
really very helpful...

View Tutorial          By: sneha at 2012-01-30 18:01:16

10. great example for beginners. Thank you
View Tutorial          By: kumar at 2011-11-24 08:15:14