📄 sendsmartringtone.java~1~
字号:
import java.io.File;import java.io.IOException;import com.objectxp.msg.GsmSmsService;import com.objectxp.msg.MessageException;import com.objectxp.msg.SmsService;import com.objectxp.msg.smart.Ringtone;/** * This example demonstrates how to send Ringtones using jSMS */public class SendSmartRingtone { public static void main(String args[]) throws IOException, MessageException { if(args.length != 2 ) { System.err.println("Usage: SendSmartRingtone <config-file> <recipient>"); System.exit(1); } // Create and initialize the SmsService (Replace GsmSmsService with // the SmsService Implementation of your choice). SmsService service = new GsmSmsService(); service.init(new File(args[0])); // create Ringtone Ringtone rt = new Ringtone(); rt.setRecipient(args[1]); rt.setMessage("Easy:d=4,o=5,b=63:8g4,32g,32d,32g,32g,32d,2p"); // connect, send message and disconnect try { service.connect(); service.sendMessage(rt); service.disconnect(); } finally { service.destroy(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -