Android calls call. The SMS function can be called directly or indirectly. You can set the intent attribute to achieve this:
Direct call without user confirmation:
// Call intent = new intent (intent. action_call, Uri. parse ("Tel: 10086"); startactivity (intent );
// SMS string smscontent = "ye"; // Note: SMS must be divided before being sent smsmanager SMS = smsmanager. getdefault (); List <string> texts = SMS. dividemessage (smscontent); For (string text: texts) {SMS. sendtextmessage ("10086", null, text, null, null );}
The caller is waiting for user confirmation:
Intent intent = new Intent( Intent.ACTION_DIAL, Uri.parse("tel:10086")); startActivity(intent);
Uri uri = Uri.parse("smsto:10086"); Intent it = new Intent(Intent.ACTION_SENDTO, uri); it.putExtra("sms_body", "ye"); startActivity(it);
Last add permissions:
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission> <uses-permission android:name="android.permission.SEND_SMS"></uses-permission>