SMS消息传递

2023-05-22,,

<Button
    android:id="@+id/send"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Send SMS"
    android:onClick="onClick"/>
public void onClick(View view){
    sendSMS("5556","Hello...");
    Toast.makeText(this,"hello",Toast.LENGTH_SHORT).show();
}

private void sendSMS(String s, String s1) {
    SmsManager smsManager = SmsManager.getDefault();
    smsManager.sendTextMessage(s,null,s1,null,null);

}

《SMS消息传递.doc》

下载本文的Word格式文档,以方便收藏与打印。