本文整理匯總了Java中org.jsmpp.bean.MessageClass類的典型用法代碼示例。如果您正苦於以下問題:Java MessageClass類的具體用法?Java MessageClass怎麽用?Java MessageClass使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MessageClass類屬於org.jsmpp.bean包,在下文中一共展示了MessageClass類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import org.jsmpp.bean.MessageClass; //導入依賴的package包/類
public static void main(String[] args) throws Exception {
SMPPSession session = null; // 1. initialize
// 2. Initiate bind
// 3. Set message receiver listener if needed
// this is how to write "house" in arabic
String house = "\u0628" + "\u064e" + "\u064a" +
"\u0652" + "\u067a" + "\u064f";
TimeFormatter timeFormatter = new RelativeTimeFormatter();
// 4. Specify the data coding using UCS2
DataCoding dataCoding = new GeneralDataCoding(Alphabet.ALPHA_UCS2, MessageClass.CLASS1, false);
// 5. UTF-16BE is equals to UCS2
byte[] data = house.getBytes("UTF-16BE");
// 6. Submit the short message
String messageId = session.submitShortMessage("CMT",
TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,
"1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,
"628176504657", new ESMClass(), (byte)0, (byte)1,
timeFormatter.format(new Date()), null,
new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0,
dataCoding,
(byte)0, data);
}