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