java类android.telephony.gsm.SmsManager的实例源码

SmsForwardReceiver.java 文件源码 项目:sagesmobile-mReceive 阅读 20 收藏 0 点赞 0 评论 0
@Override
public void onReceive(Context context, Intent intent) {
    if (!intent.getAction().equals("org.rapidandroid.intents.SMS_FORWARD")) {
        throw new RuntimeException();
    }
    SmsManager smgr = SmsManager.getDefault();
    Bundle extras = intent.getExtras();
    if (extras != null) {
        Log.d(this.getClass().getName(), "SMS forwarding in progress");
        String mesg = extras.getString("msg");
        String[] fwdnums = extras.getStringArray("forwardNums");
        for (String destinationAddr : fwdnums) {
            // String destinationAddr = extras.getString(KEY_DESTINATION_PHONE);
            // String mesg = extras.getString(KEY_MESSAGE);
            smgr.sendTextMessage(destinationAddr, null, mesg, null, null);
        }
        Log.d(this.getClass().getName(), "SMS forwarding complete");
    }

}
BarrageService.java 文件源码 项目:buildAPKsApps 阅读 26 收藏 0 点赞 0 评论 0
@Override
public void onCreate() {
    HandlerThread thread = new HandlerThread(TAG, Process.THREAD_PRIORITY_BACKGROUND);
    thread.start();

    mServiceLooper = thread.getLooper();
    mServiceHandler = new ServiceHandler(mServiceLooper);

    mSmsManager = SmsManager.getDefault();
}
Textingsvc.java 文件源码 项目:alternate-java-bridge-library 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Creates a new TextMessage component.
 *
 * @param container  ignored (because this is a non-visible component)
 */
public Textingsvc(SvcComponentContainer container) {
  super(container.$formService());
  IntentFilter intentFilter = new IntentFilter("android.provider.Telephony.SMS_RECEIVED");
  container.$context().registerReceiver(receiver, intentFilter);
  Log.d("Simple", "Texting constructor");
  smsManager = SmsManager.getDefault();
  PhoneNumber("");
  receivingEnabled = true;
  formService.registerForOnStartCommand(this);
  formService.registerForOnDestroy(this);
}
SmsReplyReceiver.java 文件源码 项目:sagesmobile-mReceive 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void onReceive(Context context, Intent intent) {
    SmsManager smgr = SmsManager.getDefault();
    Bundle extras = intent.getExtras();
    if (extras != null) {
        if (extras.containsKey(KEY_DESTINATION_PHONE) && extras.containsKey(KEY_MESSAGE)) {
            String destinationAddr = extras.getString(KEY_DESTINATION_PHONE);
            String mesg = extras.getString(KEY_MESSAGE);
            /** TODO if mesg.length > 160(i think?) chars then this throws exception. would need
             * to use the version that sends segmented sms **/
            smgr.sendTextMessage(destinationAddr, null, mesg, null, null);
        }
    }
}
CupcakeSupport.java 文件源码 项目:prey-android-client-master 阅读 21 收藏 0 点赞 0 评论 0
public static void sendSMS(String destSMS, String message) {
    SmsManager sm = SmsManager.getDefault();
    sm.sendTextMessage(destSMS, null, message, null, null);

}
SmsSend.java 文件源码 项目:cudl-prototype 阅读 20 收藏 0 点赞 0 评论 0
public void sayHello(View v) {

    String _messageNumber="+447933037883";
    String messageText = "";

    SmsManager sms = SmsManager.getDefault();
    sms.sendTextMessage(_messageNumber, null, messageText, null, null);

}


问题


面经


文章

微信
公众号

扫码关注公众号