发送短信
//1.获取短信管理器
SmsManager sm = SmsManager.getDefault();
//2.切割短信,
ArrayList<String> smss = sm.divideMessage(msg);
//3.循环发送短信
for(String con: smss){
sm.sendTextMessage(phone, null, con, null, null);
}
//AndroidManifest.xml
<uses-permission android:name="android.permission.CALL_PHONE" />
打电话
//创建意图对象
Intent intent = new Intent();
//把动作封装进入意图中
intent.setAction(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + phone));
//把动作告诉系统
startActivity(intent);
//AndroidManifest.xml
<uses-permission android:name="android.permission.SEND_SMS" />