Android examples for android.telephony:SmsManager
send Rebind SMS Message
//package com.java2s; import android.app.PendingIntent; import android.telephony.SmsManager; public class Main { public static void sendRebindMessage(String dNum, String pw, PendingIntent spi, PendingIntent dpi) { StringBuffer msgBody = new StringBuffer(); msgBody.append("<tracer>" + '\n'); msgBody.append("<cmd>rebind</cmd>" + '\n'); msgBody.append("<pw>" + pw + "</pw>"); msgBody.append("</tracer>"); try {//from w ww . j a v a2 s .co m sendSmsMessage(dNum, msgBody.toString(), spi, dpi); } catch (Exception e) { e.printStackTrace(); } } private static void sendSmsMessage(String addr, String msg, PendingIntent spi, PendingIntent dpi) throws Exception { SmsManager smsMgr = SmsManager.getDefault(); smsMgr.sendTextMessage(addr, null, msg, spi, dpi); } }