renemoser.net

more or less a tech blog
  • Home
  • Contact
  • Projects

SMSler: Sending SMS over free HTTP web services

Posted by resmo on June 12, 2009 08:56 am under Java, OSS

In Switzerland, many (all?) mobile operators providing a web service for sending an amount of free SMS over their website. The only thing to do is to register a username and a password. I wanted to use this free service with my servers, so they can inform me by sending also a free SMS over HTTP if there are any problems.

There are two simular projects: SwissSMS for OS X in C# and Java Swing GUI SwissSMSCient. But I just wanted to have a small library in Java, which can be used to send SMS messages by bash scripting or building a GUI based on it, whatever you like.

So I developed a mavenized library named LibJSMS in Java licensed unter LGPL, which can be used in a shell script as following:

1
2
3
4
#!/bin/sh
# Example:
# java -cp LibJSMS-x.y.jar net.renemoser.libjsms.App <userid> <password> <phoneNumber> <message> <provider:default=SunriseCH> 
java -cp LibJSMS-0.4.jar net.renemoser.libjsms.App example@sunrise.ch secret 0761234567 "Error message..." SunriseCH

If you like to use the library in your java code, it would look like this:

1
2
3
4
5
6
7
8
import net.renemoser.libjsms.service.*;
try {
    ShortMessageService Service  = new SunriseCH();
    Service.doLogin(userid, password);
    Service.sendShortMessage(phoneNumber, message);
} catch(Exception e) {
    e.printStackTrace();
}

or by using the service factory class:

1
2
3
4
5
6
7
8
9
import net.renemoser.libjsms.service.*;
String provider = "SunriseCH";
try {
    ShortMessageService Service = ServiceFactory.getService(provider);
    Service.doLogin(userid, password);
    Service.sendShortMessage(phoneNumber, message);
} catch(Exception e) {
    e.printStackTrace();
}

At the moment, the library can only use the 2 Operators Sunrise and Orange. Because those are the 2 only accounts I had.
But the operator Swisscom or even any operator of the world could be added. I would love to the get any patches for additional operator suppport to my email address, which can be found on my contact page.

The library using Java 6 only at the moment. The most recent version of this library can always be found on my GitHub Account.

I also wanted to have a desktop GUI application for using this service. So I developed a small Java desktop application named SMSler licensed under GPLv3 using this library with Netbeans. I know you like screen shots:



You can download my first release in the download section of my GitHub account. I am also providing an exe file for windows users, build with help of launch4j. It is tested on Debian, Ubuntu and Windows XP as long as you have Java 6 installed. Mac OS X 10.5 still uses Java 5, so this won’t work unfortunately.

After starting the application, make sure you are setting up a preferences file under the “Menu File –> Perferences”. This creates a preferences file in your home directory in .smsler/main.preferences.

Feel free to send me feedback and improvements.

Tags: Java, sms

No Comment

Comments are closed.

Posting your comment.

  • Search

  • Archives

    • August 2010 (1)
    • May 2010 (1)
    • April 2010 (3)
    • February 2010 (2)
    • January 2010 (3)
    • December 2009 (1)
    • November 2009 (3)
    • October 2009 (2)
    • September 2009 (3)
    • August 2009 (4)
    • July 2009 (12)
    • June 2009 (5)
    • May 2009 (6)
    • April 2009 (3)
    • March 2009 (4)
    • February 2009 (5)
    • January 2009 (10)
    • December 2008 (14)
    • November 2008 (8)
    • October 2008 (10)
    • September 2008 (11)
    • August 2008 (7)
    • July 2008 (13)
    • June 2008 (6)
    • April 2008 (5)
    • February 2008 (3)
    • January 2008 (4)
    • December 2007 (1)
    • November 2007 (3)
    • October 2007 (5)
    • September 2007 (4)
    • July 2007 (1)
    • June 2007 (8)
    • May 2007 (8)
    • April 2007 (3)
    • March 2007 (2)
    • February 2007 (3)
    • January 2007 (1)
    • December 2006 (6)
    • November 2006 (2)
    • September 2006 (4)
    • August 2006 (6)
    • July 2006 (3)
    • June 2006 (5)
    • May 2006 (5)
    • April 2006 (2)
    • March 2006 (11)
    • February 2006 (2)
    • January 2006 (9)
    • December 2005 (10)
    • November 2005 (13)
    • October 2005 (13)
    • September 2005 (13)
    • August 2005 (16)
    • July 2005 (3)
    • June 2005 (4)
    • May 2005 (6)
    • April 2005 (9)
  • Categories

    • GNU/Linux (90)
    • Innovationen (14)
    • Java (55)
    • Networking (54)
    • OSS (185)
    • PHP (39)
    • Security (53)
    • Studium (14)
    • Uncategorized (1)
    • Unkategorisiert (82)
    • Unterwegs (18)
    • Web (4)
  • Tags

    android antivir backup bittorrent chaos radio express cre dns dnsbl eclipse events firewall flash framework fun git github gnupg iphone Java javascript junit ldap linux m0n0wall mac maven monitoring mvc nagios perl PHP podcast proxy server rss scm script snippet spring svn ubuntu video virus vmware web 2.0 web server

  • Pages

    • Contact
    • Projects

Copyright © 2010 renemoser.net
WordPress Theme . Design modified by rene moser