Joke Collection Website - Blessing messages - How does android call the system to send SMS?

How does android call the system to send SMS?

First of all, you need to add the permission map 1 map 1 to the program manifest file AndroidManifest.xml It is a short interface for sending messages, including two TextView components, two EditText components and a Button component. In the main program, you should add the private EditText txt_num of the click event to the send button. Private edittexttxt _ content public void oncreate (bundle saved state) {super. oncreate (saved state); setContentView(r . layout . main); txt _ num =(EditText)this . findviewbyid(r . id . txt _ num); txt _ content =(EditText)this . findviewbyid(r . id . txt _ content); Button BTN _ send =(Button)this . findviewbyid(r . id . BTN _ send); BTN _ send . setonclicklistener(new onClick listener(){ public void onClick(View v){ String str _ num = txt _ num . gettext()。 toString(); //get the phone number stringstr _ content = txt _ content.gettext (). tostring(); //get SMS manager _ SMS = SMS manager. get default(); //Get SMS Manager//Because SMS may be long, split SMS into ArrayList Texts = SMS Manager. Divide message (str _ content); for(String text:texts){ SMS manager . sendtextmessage(str _ num,null,text,null,null); //Send each message separately} Toast. Maketext (SMS activity. This, "sent successfully!" , toast. Length _ length). show(); //Prompt success}}); } At this point, the function of sending SMS has been introduced.