Skip to main content

send EMS message using smsj api

No replies
newtothis
Offline
Joined: 2013-03-20
Points: 0

I am new to java programming. I have used smsj api to send messages from pc to mobile through a gsm modem. I have succesfully been able to send plain text messages using SmsSender.sendTextSms(msg, reciever, sender) as well as unicode messages using SmsSender.sendUnicodeTextSms("smsj हिन्दी मेसेज", reciever);.

They say it supports EMS messages too. I am trying to send picture messages (black and white), and audio clips through this. But i cannot figure out how to do this.

The documentation shows that there is a class EmsMessage that implements SmsMessage But i couldn't find any details on how to use it. I have also gone through its forum but again cant find any solution.

Hoping someone could guide me on this.

this is my code for sending text messages..

public class SendMessage  {

    public void send() {
    try{
        SmsSender smsSender = SmsSender.getGsmSender("COM14");
            String msg ="smsj test message";       
            String reciever = "919790968633";
            String sender ="919176968289";     
            smsSender.connect();

            smsSender.sendTextSms(msg, reciever, sender);  //simple text message

                   smsSender.sendUnicodeTextSms("smsj हिन्दी मेसेज", reciever); //unicode message

            smsSender.disconnect();

    } catch(IOException i){
        i.printStackTrace();
        System.out.println("i");
    } catch(SmsException s){
        s.printStackTrace();
        System.out.println("s");
    }
    }

    public static void main(String args[]){
        SendMessage app = new SendMessage();
        app.send();
    }


}