-2

i want to make an application in which i start service which start broadcast reciever for sms_read and every time when new sms come and reciever detact that message. no matter app is running or not.

Julia Williams
  • 103
  • 1
  • 5

1 Answers1

0

you don't have to use a Service for Reading and listening for SMS.

All you need to Do is just register a Broadcast receiver in your Application like this .

    <receiver android:name=".IncomingSms" >
        <intent-filter>
            <action android:name="android.provider.Telephony.SMS_RECEIVED" />
        </intent-filter>
    </receiver>

And just write whatever functionality you have to do upon receiving the SMS in the Broadcast receiver by starting an IntentService or a Thread

Hasif Seyd
  • 1,686
  • 12
  • 19