Beispiel #1
0
 public static void SendSms1(String to, String body)
 {
     Android.Telephony.SmsManager smsManager = Android.Telephony.SmsManager.Default;
     smsManager.SendTextMessage(to, null, body, null, null);
     //Intent sendIntent = new Intent(Intent.ActionSendto,Android.Net.Uri.Parse("smsto:" +to));
     //sendIntent.PutExtra("sms_body", body);
     //StartActivity(sendIntent);
 }
Beispiel #2
0
        public static void SendSms2(String to, String body)
        {
            //获取短信管理器
            Android.Telephony.SmsManager smsManager = Android.Telephony.SmsManager.Default;
            //拆分短信内容(手机短信长度限制)
            IList <String> divideContents = smsManager.DivideMessage(body);

            foreach (var msg in divideContents)
            {
                smsManager.SendTextMessage(to, null, msg, null, null);//android.permission.SEND_SMS
            }
        }