Implementation method of telephone dialer and SMS transmitter developed by Android
This paper describes the implementation method of telephone dialer and SMS transmitter developed by Android. Share with you for your reference, as follows:
Phone dialer
Implementation principle: the user inputs the telephone number. When clicking to dial, it is captured by the monitoring object. The monitoring object obtains the telephone number entered by the user through the text control. Since the system has realized the telephone dialing function, we only need to call this function.
Steps:
1. Interface layout 2. Write an activity 3. Activate the telephone dialing function using the intention filter 4. Add the telephone service permission (for the telephone service of the mobile phone, add the telephone service permission in the list file androidmanifest.xml)
As shown in the figure, the three controls are placed vertically, so use a linear layout to shelve the display controls
design sketch:
Interface layout:
Activity:
Add telephony permissions:
SMS transmitter
The steps of the SMS sender are similar to those of the telephone dialer. It should be noted that when the SMS content is obtained, if there are many SMS contents, the SMS content needs to be split, saved in the collection after splitting, and multiple SMS contents can be sent
design sketch:
Interface layout:
Activity:
Add SMS service permission:
I hope this article will help you in Android programming.