skip to main |
skip to sidebar
RSS Feeds
Nope. nothing .. just some random thoughts come to my mind ...
Nope. nothing .. just some random thoughts come to my mind ...
12:04 PM | Saturday, October 29, 2011
Posted by harshadura
Hello Everyone!
Today I am going to tell you about how to Simply send SMS by using your HSDPA dongle or GSM modem. Cool! Isnt It? yes Its not that Difficult too. I have tried so many ways to Accomplish this problem. After so many Attempts I got the way to do. So well I will tell you how I have done that.
package logic; import com.harshadura.gsm.smsdura.GsmModem; public class TestSMS { private static String port = "COM3"; //Modem Port. private static int bitRate = 115200; //this is also optional. leave as it is. private static String modemName = "ZTE"; //this is optional. private static String modemPin = "0000"; //Pin code if any have assigned to the modem. private static String SMSC = "+9477000003"; //Message Center Number ex. Mobitel public static void main(String[] args) throws Exception { GsmModem gsmModem = new GsmModem(); GsmModem.configModem(port, bitRate, modemName, modemPin, SMSC); gsmModem.Sender("+94712244555", "Test Message"); // (tp, msg) } }Okay in here. you will notice that you have to first find out the port number of your USB modem/dongle. for that you can simply right click the MyComputer Icon > goto Mange > then Search for Modems > then it will pop up a interface with several tabs.
gsmModem.Sender("+94712244555", "Test Message"); // (tp, msg)
Exception in thread "main" org.smslib.GatewayException: Comm library exception: java.lang.RuntimeException: javax.comm.NoSuchPortException at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java:102) at org.smslib.modem.AModemDriver.connect(AModemDriver.java:114) at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:189) at org.smslib.Service$1Starter.run(Service.java:276) Java Result: 1
9:06 AM |
Posted by harshadura
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.harshadura.gsm</groupId>
<artifactId>smsdura</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>smsdura</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.comm</groupId>
<artifactId>comm</artifactId>
<version>2.0.3</version>
<scope>system</scope>
<systemPath>${basedir}/lib/comm.jar</systemPath>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.0.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/commons-net-3.0.1.jar</systemPath>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>system</scope>
<systemPath>${basedir}/lib/log4j-1.2.16.jar</systemPath>
</dependency>
<dependency>
<groupId>jsmpp</groupId>
<artifactId>jsmpp</artifactId>
<version>2.1.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jsmpp-2.1.0.jar</systemPath>
</dependency>
<dependency>
<groupId>smslib</groupId>
<artifactId>smslib</artifactId>
<version>3.5.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/smslib-3.5.1.jar</systemPath>
</dependency>
<dependency>
<groupId>RXTXcomm</groupId>
<artifactId>RXTXcomm</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/RXTXcomm.jar</systemPath>
</dependency>
<dependency>
<groupId>pduutils</groupId>
<artifactId>pduutils</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/pduutils.jar</systemPath>
</dependency>
</dependencies>
</project>
After then just type
mvn clean install
4:00 PM | Saturday, October 8, 2011
Posted by harshadura
This is a Project which I have done with few of my colleagues specifically for SLIIT ITP Subject.
I have open sourced the Full source Code at github and rest of the project gonna Open sourced at Sourceforge FOSS home.
I am really thankful to Roshan Ayya, Dr. Dikaz Sheriff at Western Hospital, Colombo for giving lots of helps to make this Product a Success.
The ripen is a lil intro on whats it? and how it works.
visit the official project web portal to see more.thx