i want to start an application on receiving sms from a particular number.
i am trying it with onMessageWaitingIndicatorChanged(boolean mwi){ } method but
i m struggling.
so, anyone there to help me in detail?
Thanks
i want to start an application on receiving sms from a particular number. i
Share
You’ll need to register a broadcast receiver for
android.provider.Telephony.SMS_RECEIVED. The receiver can then check the number of the SMS and start your activity as appropriate.So, you’ll need to:
uses-permissionforandroid.permission.RECEIVE_SMSto your manifestDeclare a broadcast receiver in your
<application/>element in the manfiest:Create the receiver class, extending
IntentReceiver.onReceiveIntent, you can get the relevant messages by callingTelephony.Sms.Intents.getMessagesFromIntent()and passing in the intent you’re supplied.startActivity