. Registerreceiver (NewBroadcastreceiver () {@Override Public voidonreceive (Context _context, Intent _intent) {toast.maketext (mainactivity. This, "The addressee has successfully received the message.", Toast.length_short). Show (); } }, NewIntentfilter (delivered_sms_action));Don't forget the question of permissions:Description of the parameters for sending SMS:Smsmanager.sendtextmessage (destinationaddress, scaddress, text, sentintent, deliveryintent)--destinationaddress: Targ
The gentleman wants to be in the speech and is sensitive to the line.-The Analects of Confucius Recently, the body is a bit uncomfortable, only to notice the body is really the most important , no matter how busy we are, we must rest on time, insist on running, exercise, do some of the cervical spine and so on, do not let us earn money to see the doctor, we come together to insist Ah, do not let the young blinded our eyes.In the Android development of
1. Based on the broadcast accept SMS 1.1 principle Android receives a text message and the system sends a Android.provider.Telephony.SMS_RECEIVED broadcast. Put it in bundle (Intent.extras), bundle can be understood as a map, text message using "PDUs" as the key, PDUs should be protocol description units shorthand, that is, a set of text messages. Android does no
Android System SMS Source Library Click to open the linkAndroid System SMS Source Click to open the linkThe new project needs to do the SMS module function, this SMS module non-android system
The SMS listener obtains the content, time, sender, and other information of the information when it receives the information, and then processes the information, which can shield the user from seeing the information, forwarding it, or sending it to the web for processing. Exciting function ..
Let's take a look at its implementation principles.
In fact, SMS reception is implemented by the broadcast receiver
permissions:then hit "Application" to add the following activity:Five, running exampleThen click to get the verification code, the text message will be automatically entered into the verification code edittext.SMS Verification code can also be used to retrieve the password function, you can set the intent jump on their own can be.Like a friend can pay attention to me! Thank you! Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The author found that in many applications, there are automatic access to the Verification code function: Click to get the Verification Code button, received SMS, the current application does not need to exit the program can get to the text of the verification code, and automatically fill. Feel this kind of user experience is very good, do not need a user to switch back and forth between SMS and app, how is
will only be shown in the test phase, the online will only show your app nameAbout validation ...SMS send completion can call the official authentication interface for correctness check, these are done on the mob server, we only need to know the results, call method See official documentshttp://wiki.mob.com/sms-android-%E6%97%A0gui%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%
. Event_get_verification_code) {Toast.maketext (Getapplicationcontext (), "Authenticode sent", Toast.length_short). Show ();} else {((throwable) data). Printstacktrace ();}}}}; @Overrideprotected void OnDestroy () {Super.ondestroy ();//this.unregisterreceiver (Smsbroadcastreceiver); Smssdk.unregisteralleventhandler ();}Summary At this point, a text verification function has been implemented. The platform has some limitations and the app must be networked. The verification code can only be 4 bits
android:priority= "100" to the intent-filter tag in each receiver of the configuration file, the higher the number
* The greater the priority.
*
* @author Administrator
*
*/
There are a lot of basic concepts about broadcasting, so broadcastreceiver in the actual application will play a role in the end?Because broadcast is a system-level listener, it can be a "tie" between different interprocess communications. As a simple example, we know that when we
Android SMS database detailed summary and analysis of SMS files/data/COM. Android. providers. telephony/databases/mmssms. DB
The database has 13 tables, and the SMS table contains SMS information.
The URI of the
I. Introduction to the principle of text message listening the purpose of text message listening is to eavesdrop on text messages sent by someone. For example, we have installed this app on a's mobile phone and want to check the text message sent by B to;
How can we get short messages? If a message is sent to a third party via SMS, the message is displayed. Therefore, the message can be sent to the Web server over the network. The messaging applicatio
I. Introduction to SMS listening principles
The purpose of text message listening is to eavesdrop on text messages sent by someone. For example, we have installed this app on A's mobile phone to view the text messages sent by B to;
How can we get short messages? If a message is sent to a third party, the message is displayed. Therefore, the message can be sent to the web server over the network;
The Messaging application in
Bmob back-end cloud, this is not what I said, it is very important in our Android development process. Specifically what services can be bmob the official website to inquireabout how to implement the method of SMS verification code, in fact, Bmob in the back end of the cloud has been introduced in detail. The main thing I'm here for is to share my experience.1. To implement
This article is an example of how Android sends SMS. Share to everyone for your reference, specific as follows:
SMS and phone calls are the basic features of Android phones, and here are examples of how Android can deliver text messages.
The program looks like this:
I
ContentValues(); cv.put("address", destinationAddress); cv.put("person", ""); cv.put("protocol", "0"); cv.put("read", "1"); cv.put("status", "-1"); cv.put("body", text); this.getContentResolver().insert(Uri.parse("content://sms/sent"), cv); Log.e("tl3shi", "msg has stored");
The system automatically matches the session information of the same person. Note that the above Code permission must
I, broadcast recipientBroadcast recipient Broadcastreceiver, how to understand the broadcast receiver?System, there are many special events, such as SD card mount, outgoing calls, receive SMS and other events. We just have to register a broadcast receiver, the equivalent of buying a radio, we can receive these special events.These events, when they happen, always send out broadcasts.II, implementing IP dialing1)Effect: Enter a number to be stored as a
Long-winded: I found my blog was reposted, but I didn't specify the source. It felt a little painful and happy. Here we formally declare: reprinted, please indicate the source, thank you. If you have commercial purposes, please be sure to inform me.
The SMS function on Android is basically stable and rarely maintained, so it is always unfamiliar. % >_Let's talk about the smsmanager class:According to the s
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.