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



Ask a Question

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. No it won't work...
View Tutorial          By: Arin at 2012-08-17 09:59:40

2. Hi Chriz,
Yes it should work on any site. B

View Tutorial          By: William at 2010-07-10 20:54:24

3. very good description ,clear and simple
View Tutorial          By: swapnil at 2011-06-24 06:33:10

4. @Vipin : vipin u r wrong,,,in reality java does n
View Tutorial          By: Arpit Tyagi at 2010-07-23 04:11:20

5. I am not found a J2ME file for playing a audio pla
View Tutorial          By: S.M. ASHIQUER RAHMAN at 2008-11-22 22:33:43

6. What about for an iPad and iPhone!
View Tutorial          By: Kamalakannan at 2012-09-21 06:10:39

7. nice example . and good job.
View Tutorial          By: mohit sinha at 2011-04-07 03:19:01

8. hi ..........
the code is worked for me....

View Tutorial          By: pradeep at 2012-01-25 06:30:14

9. Plz help me......its urgent
i need a code

View Tutorial          By: Nisha at 2010-03-22 00:38:42

10. really nice
View Tutorial          By: umer at 2011-06-25 06:35:19