我正在使用SMSLib 3.5.2库来发送/接收短信。当我尝试通过实现回调方法时,我没有收到消息。此外,甚至从不调用来电通知的功能。 任何帮助都将受到高度赞赏.....
gateway = new SerialModemGateway(MODEM_IDENTIFIER, SERIAL_PORT, BAUD_RATE, MODEM_MANUFACTURER,"");
gateway.setInbound(true);
gateway.setOutbound(true);
ICallNotificationI ic = new ICallNotificationI();
Service.getInstance().setCallNotification(ic);
Service.getInstance().addGateway(gateway);
Service.getInstance().startService();
,实现接口ICallNotification的类永远不会被调用:
public class ICallNotificationI implements ICallNotification {
@Override
public void process(AGateway gateway, String callerId) {
System.out.print("Hello Buddy in the call");
MLog.log(Level.INFO, ".ICallNotification.Process", "We rececived call"
+ " from this number "+callerId);
}