我正在使用 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);
}