Wemall App Store source Android SMS monitor receiver

Source: Internet
Author: User

Wemall Doraemon is the Android client program, the server uses Wemall Mall, do not make any changes to the original mall, only need to upload the interface file in the original mall directory to complete the server configuration, the client can be arbitrarily customized modification. This article share SMS listening receiver, used to automatically obtain SMS verification code, and then automatically fill in the code area codes for the technician reference learning.

Package Cn.smssdk.gui;import Android.content.broadcastreceiver;import Android.content.context;import Android.content.intent;import Android.os.bundle;import Android.telephony.smsmessage;import Android.util.Log; Import cn.smssdk.smssdk;/** SMS Listener receiver, for automatic SMS Verification code, and then automatically fill in the Verification Code area */public class Smsreceiver extends Broadcastreceiver { private static final String Action_sms_receiver = "Android.provider.Telephony.SMS_RECEIVED";p rivate smssdk. Verifycodereadlistener listener;public smsreceiver (smssdk. Verifycodereadlistener verifycodereadlistener) {this.listener = Verifycodereadlistener;} /** * Do not register receiver using the Androidmanifest.xml configuration, * Use Context.registerreceiver to register the listener, because the listener is passed in when initializing */public smsreceiver () {String msg = "Dynamically register an instance of this class with Context.registerreceiver." + "\r\nif not, the SMSSDK. Verifycodereadlistener would be null! "; LOG.W ("Cn.smssdk.gui.SMSReceiver", msg);} @Overridepublic void OnReceive (context context, Intent Intent) {if (Action_sms_receiver.equals (Intent. Getaction ())) {Bundle bundle = Intent.getextras (); if (Bundle! = null) {object[] PDUs = (object[]) bundle.g                ET ("PDUs");                smsmessage[] Smsarr = new Smsmessage[pdus.length];                for (int i = 0; i < pdus.length; i++) {Smsarr[i] = SMSMESSAGE.CREATEFROMPDU ((byte[]) pdus[i]);} for (Smsmessage Sms:smsarr) {if (SMS! = NULL) {Smssdk.readverificationcode (SMS, L                Istener); }}}//END if (bundle! = NULL)}}}

  

Original Details Address: http://Git.oschina.NET/zzunet/wemall-doraemon/commit/e8f303df5663dc69fe47bb9623222149d40e3956

Wemall doraemonandroid App Store details address: http://www.koahub.com/home/product/55

Wemall website Address: http://www.wemallshop.com

Wemall Open Source Micro-mall, mall, mall source code, level three distribution, micro-fresh, micro-fruit, micro-takeaway, micro-ordering---professional system

Wemall App Store source Android SMS monitor receiver

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.