Comment on Tutorial - How to Send SMS using Java Program (full code sample included) By Emiley J.
Comment Added by : chetan
Comment Added at : 2007-10-17 08:13:14
Comment on Tutorial : How to Send SMS using Java Program (full code sample included) By Emiley J.
we are java research students.
we are working on sms based project, we have one issue of sending sms on fedora 7 with fargo maestro 20 gsm modem.Our Modem is connected to Serial Port.
We are newbies in Linux & having average knowlegde of java, j2me...
We have installed sun java in the linux box..then comm.jar api.
the deployment of the .so & java.comm jar is done as per requirement
our application is based on the following code:
http://www.java-samples.com/showtutorial.php?tutorialid=22
we have complied java files...then we have written the shell file for running the java class file.
--------------------------------------------------------------------------------
//DemoSms.java
public class DemoSms
{
public static void main(String args[])
{
SMSClient sc = new SMSClient(1);
sc.sendMessage("MyCellNo","Hello");
}
}
//ends here
#shell file
JAVA_HOME=/opt/jdk1.5.0_12
CLASSPATH=/opt/sms:$JAVA_HOME/jre/lib/comm.jar
$JAVA_HOME/bin/java -cp $CLASSPATH DemoSms
#shell file ends here
--------------------------------------------------------------------------------
/*
Console message errors we get are as follows
*/
[[email protected] ~]# sh SmsSend.sh
/dev/ttyS0
PortId = [email protected]
java.io.IOException: Not all params are supported by kernel
at com.sun.comm.LinuxSerial.nativeSetSerialPortParams(Native Method)
at com.sun.comm.LinuxSerial.setSerialPortParams(LinuxSerial.java:346)
at SerialConnection.setConnectionParameters(SerialConnection.java:167)
at SerialConnection.openConnection(SerialConnection.java:100)
at Sender.send(Sender.java:44)
at SMSClient.run(SMSClient.java:39)
at java.lang.Thread.run(Thread.java:595)
[1]+ Stopped sh SmsSend.sh
[[email protected] ~]# sh SmsSend.sh
/dev/ttyS0
PortId = [email protected]
java.lang.RuntimeException:
Error opening "/dev/ttyS0"
lockf(): Resource temporarily unavailable
at com.sun.comm.LinuxDriver.getCommPort(LinuxDriver.java:66)
at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:369)
at SerialConnection.openConnection(SerialConnection.java:89)
at Sender.send(Sender.java:44)
at SMSClient.run(SMSClient.java:39)
at java.lang.Thread.run(Thread.java:595)
--------------------------------------------------------------------------------
As we are newbies we are not able to trace where the actual problem is...
We have used this modem in windows env and it runs perfectly..
We have tried confirguring minicom also to try to send sms but we have failed in doing so..
We have already put around 20 hours trying to find the error but with no use..
Please help!!!..
View Tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
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
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program 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
Archived Comments
1. PROGRAM TO FIND OUT SMALLER NU:-
cl
View Tutorial By: ishaan gogna at 2012-05-09 19:00:49
2. thank's for the info.. i've learned a lot.. now, i
View Tutorial By: farah talabo at 2012-01-08 23:55:14
3. when i trying this code . i am getting this error<
View Tutorial By: sharath at 2010-04-06 00:58:29
4. i have created the main class to run the five clas
View Tutorial By: Muraya at 2014-04-08 14:48:36
5. Of course you can use this in a web application. A
View Tutorial By: Ramlak at 2008-09-17 08:24:21
6. Appriciated, The information is very useful and st
View Tutorial By: Bala Gummadi at 2009-02-24 10:01:50
7. nice ....Simple undersstanding..
View Tutorial By: Anjaneyulu at 2013-06-15 04:43:45
8. while i am executing this program i am getting Nul
View Tutorial By: Seema at 2013-11-26 18:39:15
9. Nice post. Can you tell me how can i add shape in
View Tutorial By: Sonia at 2012-06-08 04:57:18
10. Nice one
View Tutorial By: Kalpana at 2009-11-17 02:04:14