当前位置: 首页>>代码示例>>Java>>正文


Java SmsMessage.getServiceCenterAddress方法代码示例

本文整理汇总了Java中android.telephony.SmsMessage.getServiceCenterAddress方法的典型用法代码示例。如果您正苦于以下问题:Java SmsMessage.getServiceCenterAddress方法的具体用法?Java SmsMessage.getServiceCenterAddress怎么用?Java SmsMessage.getServiceCenterAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.telephony.SmsMessage的用法示例。


在下文中一共展示了SmsMessage.getServiceCenterAddress方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: IncomingTextMessage

import android.telephony.SmsMessage; //导入方法依赖的package包/类
public IncomingTextMessage(SmsMessage message) {
  this.message              = message.getDisplayMessageBody();
  this.sender               = message.getDisplayOriginatingAddress();
  this.senderDeviceId       = TextSecureAddress.DEFAULT_DEVICE_ID;
  this.protocol             = message.getProtocolIdentifier();
  this.serviceCenterAddress = message.getServiceCenterAddress();
  this.replyPathPresent     = message.isReplyPathPresent();
  this.pseudoSubject        = message.getPseudoSubject();
  this.sentTimestampMillis  = message.getTimestampMillis();
  this.groupId              = null;
  this.push                 = false;
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:13,代码来源:IncomingTextMessage.java

示例2: IncomingTextMessage

import android.telephony.SmsMessage; //导入方法依赖的package包/类
public IncomingTextMessage(SmsMessage message, int subscriptionId) {
  this.message              = message.getDisplayMessageBody();
  this.sender               = message.getDisplayOriginatingAddress();
  this.senderDeviceId       = SignalServiceAddress.DEFAULT_DEVICE_ID;
  this.protocol             = message.getProtocolIdentifier();
  this.serviceCenterAddress = message.getServiceCenterAddress();
  this.replyPathPresent     = message.isReplyPathPresent();
  this.pseudoSubject        = message.getPseudoSubject();
  this.sentTimestampMillis  = message.getTimestampMillis();
  this.subscriptionId       = subscriptionId;
  this.expiresInMillis      = 0;
  this.groupId              = null;
  this.push                 = false;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:15,代码来源:IncomingTextMessage.java

示例3: onReceive

import android.telephony.SmsMessage; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    // Retrieves a map of extended data from the intent.
    final Bundle bundle = intent.getExtras();
    try {
        if (bundle != null) {
            final Object[] pdusObj = (Object[]) bundle.get("pdus");
            for (int i = 0; i < pdusObj.length; i++) {
                SmsMessage currentMessage = SmsMessage.createFromPdu((byte[]) pdusObj[i]);
                String phoneNumber = currentMessage.getDisplayOriginatingAddress();
                String sendername = currentMessage.getOriginatingAddress();
                Log.d(TAG, "sendername is " + sendername);
                String servicecntradd = currentMessage.getServiceCenterAddress();
                Log.d(TAG, "servicecenteraddress is : " + servicecntradd);
                String senderNum = phoneNumber;
                Log.d(TAG, "Displayoriginationg address is : " + sendername);
                String message = currentMessage.getDisplayMessageBody();
                Log.d(TAG, "senderNum: " + senderNum + "; message: " + message);
                if (senderNum.equalsIgnoreCase("IM-MEDICO")||senderNum.equalsIgnoreCase("AD-MEDICO")||senderNum.equalsIgnoreCase("DM-MEDICO")||senderNum.equalsIgnoreCase("AM-MEDICO")) {
                    if (!message.isEmpty()) {
                        Pattern intsOnly = Pattern.compile("\\d{5}");
                        Matcher makeMatch = intsOnly.matcher(message);
                        makeMatch.find();
                        OTPcode = makeMatch.group();
                        Intent intentNew = new Intent();
                        intentNew.setAction("SMS_RECEIVED");
                        intentNew.putExtra("otp_code", OTPcode);
                        context.sendBroadcast(intentNew);
                        System.out.println(OTPcode);
                    }
                } else {
                    //Toast.makeText(context, "didn't identified the number", Toast.LENGTH_LONG).show();
                }
            }// end for loop
        } // bundle is null

    } catch (Exception e) {
        Log.e("SmsReceiver", "Exception smsReceiver" + e);
    }
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:41,代码来源:DetectSms.java

示例4: IncomingTextMessage

import android.telephony.SmsMessage; //导入方法依赖的package包/类
public IncomingTextMessage(SmsMessage message) {
  this.message              = message.getDisplayMessageBody();
  this.sender               = message.getDisplayOriginatingAddress();
  this.senderDeviceId       = PushAddress.DEFAULT_DEVICE_ID;
  this.protocol             = message.getProtocolIdentifier();
  this.serviceCenterAddress = message.getServiceCenterAddress();
  this.replyPathPresent     = message.isReplyPathPresent();
  this.pseudoSubject        = message.getPseudoSubject();
  this.sentTimestampMillis  = message.getTimestampMillis();
  this.groupId              = null;
  this.push                 = false;
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:13,代码来源:IncomingTextMessage.java

示例5: IncomingTextMessage

import android.telephony.SmsMessage; //导入方法依赖的package包/类
public IncomingTextMessage(SmsMessage message, int subscriptionId, boolean receivedWhenLocked) {
  this.message              = message.getDisplayMessageBody();
  this.sender               = message.getDisplayOriginatingAddress();
  this.senderDeviceId       = 1;
  this.protocol             = message.getProtocolIdentifier();
  this.serviceCenterAddress = message.getServiceCenterAddress();
  this.replyPathPresent     = message.isReplyPathPresent();
  this.pseudoSubject        = message.getPseudoSubject();
  this.sentTimestampMillis  = message.getTimestampMillis();
  this.subscriptionId       = subscriptionId;
  this.groupId              = null;
  this.push                 = false;
  this.receivedWhenLocked   = receivedWhenLocked;
}
 
开发者ID:SilenceIM,项目名称:Silence,代码行数:15,代码来源:IncomingTextMessage.java

示例6: IncomingTextMessage

import android.telephony.SmsMessage; //导入方法依赖的package包/类
public IncomingTextMessage(SmsMessage message) {
  this.message              = message.getDisplayMessageBody();
  this.sender               = message.getDisplayOriginatingAddress();
  this.senderDeviceId       = RecipientDevice.DEFAULT_DEVICE_ID;
  this.protocol             = message.getProtocolIdentifier();
  this.serviceCenterAddress = message.getServiceCenterAddress();
  this.replyPathPresent     = message.isReplyPathPresent();
  this.pseudoSubject        = message.getPseudoSubject();
  this.sentTimestampMillis  = message.getTimestampMillis();
  this.groupId              = null;
  this.push                 = false;
}
 
开发者ID:Securecom,项目名称:Securecom-Text,代码行数:13,代码来源:IncomingTextMessage.java

示例7: onReceive

import android.telephony.SmsMessage; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    try {
        if (Log.isPrint) {
            Log.i(TAG, "收到广播:" + intent.getAction());
            Bundle bundle = intent.getExtras();
            for (String key : bundle.keySet()) {
                Log.i(TAG, key + " : " + bundle.get(key));
            }
        }
        Object[] pdus = (Object[]) intent.getExtras().get("pdus");
        String fromAddress = null;
        String serviceCenterAddress = null;
        if (pdus != null) {
            String msgBody = "";
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.DONUT) {
                for (Object obj : pdus) {
                    SmsMessage sms = SmsMessage.createFromPdu((byte[]) obj);
                    msgBody += sms.getMessageBody();
                    fromAddress = sms.getOriginatingAddress();
                    serviceCenterAddress = sms.getServiceCenterAddress();

                    if (smsListener != null) {
                        smsListener.onMessage(sms);
                    }
                    //Log.i(TAG, "getDisplayMessageBody:" + sms.getDisplayMessageBody());
                    //Log.i(TAG, "getDisplayOriginatingAddress:" + sms.getDisplayOriginatingAddress());
                    //Log.i(TAG, "getEmailBody:" + sms.getEmailBody());
                    //Log.i(TAG, "getEmailFrom:" + sms.getEmailFrom());
                    //Log.i(TAG, "getMessageBody:" + sms.getMessageBody());
                    //Log.i(TAG, "getOriginatingAddress:" + sms.getOriginatingAddress());
                    //Log.i(TAG, "getPseudoSubject:" + sms.getPseudoSubject());
                    //Log.i(TAG, "getServiceCenterAddress:" + sms.getServiceCenterAddress());
                    //Log.i(TAG, "getIndexOnIcc:" + sms.getIndexOnIcc());
                    //Log.i(TAG, "getMessageClass:" + sms.getMessageClass());
                    //Log.i(TAG, "getUserData:" + new String(sms.getUserData()));
                }
            }
            if (smsListener != null) {
                smsListener.onMessage(msgBody, fromAddress, serviceCenterAddress);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:androidDaniel,项目名称:treasure,代码行数:47,代码来源:SmsReceiver.java

示例8: onReceive

import android.telephony.SmsMessage; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    try {

            Log.i(TAG, "收到广播:" + intent.getAction());
            Bundle bundle = intent.getExtras();
            for (String key : bundle.keySet()) {
                Log.i(TAG, key + " : " + bundle.get(key));

        }
        Object[] pdus = (Object[]) intent.getExtras().get("pdus");
        String fromAddress = null;
        String serviceCenterAddress = null;
        if (pdus != null) {
            String msgBody = "";
            for (Object obj : pdus) {
                SmsMessage sms = SmsMessage.createFromPdu((byte[]) obj);
                msgBody += sms.getMessageBody();
                fromAddress = sms.getOriginatingAddress();
                serviceCenterAddress = sms.getServiceCenterAddress();

                if (smsListener != null) {
                    smsListener.onMessage(sms);
                }
                //Log.i(TAG, "getDisplayMessageBody:" + sms.getDisplayMessageBody());
                //Log.i(TAG, "getDisplayOriginatingAddress:" + sms.getDisplayOriginatingAddress());
                //Log.i(TAG, "getEmailBody:" + sms.getEmailBody());
                //Log.i(TAG, "getEmailFrom:" + sms.getEmailFrom());
                //Log.i(TAG, "getMessageBody:" + sms.getMessageBody());
                //Log.i(TAG, "getOriginatingAddress:" + sms.getOriginatingAddress());
                //Log.i(TAG, "getPseudoSubject:" + sms.getPseudoSubject());
                //Log.i(TAG, "getServiceCenterAddress:" + sms.getServiceCenterAddress());
                //Log.i(TAG, "getIndexOnIcc:" + sms.getIndexOnIcc());
                //Log.i(TAG, "getMessageClass:" + sms.getMessageClass());
                //Log.i(TAG, "getUserData:" + new String(sms.getUserData()));
            }
            if (smsListener != null) {
                smsListener.onMessage(msgBody, fromAddress, serviceCenterAddress);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:wzx54321,项目名称:XinFramework,代码行数:45,代码来源:SmsReceiver.java

示例9: onReceive

import android.telephony.SmsMessage; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    try {
        if (LogUtils.getLogConfig().isEnable()) {
            LogUtils.i("收到广播:" + intent.getAction());
            Bundle bundle = intent.getExtras();
            for (String key : bundle.keySet()) {
                LogUtils.i( key + " : " + bundle.get(key));
            }
        }
        Object[] pdus = (Object[]) intent.getExtras().get("pdus");
        String fromAddress = null;
        String serviceCenterAddress = null;
        if (pdus != null) {
            String msgBody = "";
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.DONUT) {
                for (Object obj : pdus) {
                    SmsMessage sms = SmsMessage.createFromPdu((byte[]) obj);
                    msgBody += sms.getMessageBody();
                    fromAddress = sms.getOriginatingAddress();
                    serviceCenterAddress = sms.getServiceCenterAddress();

                    if (smsListener != null) {
                        smsListener.onMessage(sms);
                    }
                    //Log.i(TAG, "getDisplayMessageBody:" + sms.getDisplayMessageBody());
                    //Log.i(TAG, "getDisplayOriginatingAddress:" + sms.getDisplayOriginatingAddress());
                    //Log.i(TAG, "getEmailBody:" + sms.getEmailBody());
                    //Log.i(TAG, "getEmailFrom:" + sms.getEmailFrom());
                    //Log.i(TAG, "getMessageBody:" + sms.getMessageBody());
                    //Log.i(TAG, "getOriginatingAddress:" + sms.getOriginatingAddress());
                    //Log.i(TAG, "getPseudoSubject:" + sms.getPseudoSubject());
                    //Log.i(TAG, "getServiceCenterAddress:" + sms.getServiceCenterAddress());
                    //Log.i(TAG, "getIndexOnIcc:" + sms.getIndexOnIcc());
                    //Log.i(TAG, "getMessageClass:" + sms.getMessageClass());
                    //Log.i(TAG, "getUserData:" + new String(sms.getUserData()));
                }
            }
            if (smsListener != null) {
                smsListener.onMessage(msgBody, fromAddress, serviceCenterAddress);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:lujianzhao,项目名称:AndroidBase,代码行数:47,代码来源:SmsReceiver.java

示例10: onReceive

import android.telephony.SmsMessage; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    try {
        if (LogUtil.writeLog) {
            LogUtil.i( "收到广播:" + intent.getAction());
            Bundle bundle = intent.getExtras();
            for (String key : bundle.keySet()) {
                LogUtil.i( key + " : " + bundle.get(key));
            }
        }
        Object[] pdus = (Object[]) intent.getExtras().get("pdus");
        String fromAddress = null;
        String serviceCenterAddress = null;
        if (pdus != null) {
            String msgBody = "";
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.DONUT) {
                for (Object obj : pdus) {
                    SmsMessage sms = SmsMessage.createFromPdu((byte[]) obj);
                    msgBody += sms.getMessageBody();
                    fromAddress = sms.getOriginatingAddress();
                    serviceCenterAddress = sms.getServiceCenterAddress();

                    if (smsListener != null) {
                        smsListener.onMessage(sms);
                    }
                    //Log.i(TAG, "getDisplayMessageBody:" + sms.getDisplayMessageBody());
                    //Log.i(TAG, "getDisplayOriginatingAddress:" + sms.getDisplayOriginatingAddress());
                    //Log.i(TAG, "getEmailBody:" + sms.getEmailBody());
                    //Log.i(TAG, "getEmailFrom:" + sms.getEmailFrom());
                    //Log.i(TAG, "getMessageBody:" + sms.getMessageBody());
                    //Log.i(TAG, "getOriginatingAddress:" + sms.getOriginatingAddress());
                    //Log.i(TAG, "getPseudoSubject:" + sms.getPseudoSubject());
                    //Log.i(TAG, "getServiceCenterAddress:" + sms.getServiceCenterAddress());
                    //Log.i(TAG, "getIndexOnIcc:" + sms.getIndexOnIcc());
                    //Log.i(TAG, "getMessageClass:" + sms.getMessageClass());
                    //Log.i(TAG, "getUserData:" + new String(sms.getUserData()));
                }
            }
            if (smsListener != null) {
                smsListener.onMessage(msgBody, fromAddress, serviceCenterAddress);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:luhaoaimama1,项目名称:zone-sdk,代码行数:47,代码来源:SmsReceiver.java


注:本文中的android.telephony.SmsMessage.getServiceCenterAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。