1. Implementation of telephone Dialers
Permission
<Uses-Permission Android: Name = "android. Permission. call_phone"/>
JavaCode:
Intent intent = new intent (intent. action_call, Uri. parse ("Tel:" + edittext. gettext (); dialeraction. This. startactivity (intent );
2. Implementation of SMS sending
Permission
activity code:
string mobile = mobileview. gettext (). tostring (); string content = contentview. gettext (). tostring (); smsmanager = smsmanager. getdefault (); pendingintent sentintent = pendingintent. getbroadcast (context, 0, new intent (), 0); If (content. length ()> 70) {// if the number of words exceeds 70, you need to split it into multiple SMS sending lists
msgs = smsmanager. dividemessage (content); For (string MSG: MSGs) {smsmanager. sendtextmessage (mobile, null, MSG, sentintent, null); // The last two parameters are the broadcast intent sent by the SMS, the last parameter is the broadcast intent that the recipient has received the SMS.} else {smsmanager. sendtextmessage (mobile, null, content, sentintent, null);} toast. maketext (smssender. this, "message sent successfully", toast. length_long ). show ();