Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - sms br
Search - sms br - List

1、将jre文件夹复制到你本机所在的JDK下覆盖掉全部jre文件夹

2、将lib文件夹复制到你项目所在的lib,添加对应lib


import org.smslib.IOutboundMessageNotification;
import org.smslib.Library;
import org.smslib.MessageEncodings;
import org.smslib.MessageProtocols;
import org.smslib.OutboundMessage;
import org.smslib.Service;
import org.smslib.modem.SerialModemGateway;
import java.util.List;


public class SendSms {
    public SendSms() {
    }


    public void sendSMS(String[] phoneNumber) throws Exception {
        Service srv;
        OutboundMessage msg;

        OutboundNotification outboundNotification = new OutboundNotification();

        srv = new Service();
        SerialModemGateway gateway = new SerialModemGateway("modem.com1",
                "COM1", 9600, null, null);
        gateway.setInbound(true);
        gateway.setOutbound(true);
        gateway.setSimPin("0000");
        gateway.setOutboundNotification(outboundNotification);
        gateway.setProtocol(MessageProtocols.PDU);
        srv.addGateway(gateway);

        try {
            srv.startService();

            for (int i = 0; i < phoneNumber.length; i++) {
                msg = new OutboundMessage(phoneNumber[i], "您有会议待处理,请登陆查看!");
                msg.setEncoding(MessageEncodings.ENCUCS2);
                srv.sendMessage(msg);

            }

        } finally {
            srv.stopService();
        }
    }

    public class OutboundNotification implements IOutboundMessageNotification {
        public void process(String gatewayId, OutboundMessage msg) {
            System.out.println("Outbound handler called from Gateway: " +
                               gatewayId);
            System.out.println(msg);
        }
    }


    public static void main(String args[]) {
        SendSms app = new SendSms();
        try {
            app.doIt();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
 


Date : 2009-01-03 Size : 1015.8kb User : idhuanghao

Gsm modem 模块软件开发包 基于GSM标准: ETSI GSM 07.07, ETSI GSM 07.05 提供Nix,win系统 PDU 编码.支?BR> [110system.rar] - 是一个编写手机短信源码,用VC++实现,界面洁简,是一个不错的学习作品. -G.711 modem module software development kit based on the GSM standard : ETSI GSM 07.07. ETSI GSM 07.05 for Nix, win PDU coding system. Support
Date : 2025-07-11 Size : 1.43mb User : 阮正

DL : 0
BREW 短信开开发的例子,适合刚学习brew的同学-BREW SMS Program sample
Date : 2025-07-11 Size : 2.11mb User : zzzz
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.