0
我需要你的这个主题的帮助:使用JSSC和Android手机从Java形式发送短信
我想从与USB接口连接到笔记本电脑和发送文本应当从编写手机发短信一个Java表单。我试图使用JSSC库做一些代码,但是它不起作用,因为SMS没有发送。连接良好,通信也很好,但短信不发送。你们能帮助我吗?
public static void main(String[] args) {
SerialPort port = new SerialPort("COM3");
char enter = 13;
char control_z=26;
char comilla = 34;
try {
System.out.println("Port open: " + port.openPort());
System.out.println("Params setted: " + port.setParams(9600, 8, 1, 0));
System.out.println("Set to SMS: " + port.writeBytes(("AT+CMGF=1"+enter).getBytes()));
System.out.println("Set the destinatar: " + port.writeBytes(("AT+CMGS"+comilla+"+phone_number"+comilla+enter).getBytes()));
System.out.println("Set the text: " + port.writeBytes(("text"+control_z).getBytes()));
System.out.println("Port closed: " + port.closePort());
}
catch (SerialPortException ex){
System.out.println(ex);
}
}
你的错误是什么?你能附上错误吗? –
其实一切看起来都很好,但事实并非如此。输出显示(带好电话号码:)): 运行: 端口开放:真 PARAMS设置好的:真 设置为短信:真 设置destinatar:真 设置文字:真 端口的关闭:真 BUILD SUCCESSFUL – iulia2000
我使用Windows 64位,我不能使用通信库...... :( – iulia2000