 <p>If you need to receive sms during application opened (not as service), you can put Receiver in Main activity as mentioned in hewwcn answer. </p> <p>For example:</p> <pre><code>public class MainActivity extends Activity { /* * Variables for BroadcastReceiver */ boolean isRegistered = false; // check if BroadcastReceiver registered private IntentFilter filterSmsReceived = new IntentFilter( "android.provider.Telephony.SMS_RECEIVED"); /** * Create BroadcastReceiver */ private BroadcastReceiver smsReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals( "android.provider.Telephony.SMS_RECEIVED")) { /* get the SMS message passed in */ Bundle bundle = intent.getExtras(); SmsMessage[] msgs = null; String msgFrom = null; String msgBody = null; if (bundle != null) { /* retrieve the SMS message received */ try { Object[] pdus = (Object[]) bundle.get("pdus"); msgs = new SmsMessage[pdus.length]; for (int i = 0; i &lt; msgs.length; i++) { msgs[i] = SmsMessage .createFromPdu((byte[]) pdus[i]); msgFrom = msgs[i].getOriginatingAddress(); msgBody = msgs[i].getMessageBody(); } /* * TODO Show dialog */ } catch (Exception e) { // Log.d("Exception caught",e.getMessage()); } } } } }; /** * Button - register BroadcastReceiver when clicked (or put it to onCreate) */ public void onButtonClicked(View v) { this.registerReceiver(smsReceiver, filterSmsReceived); isRegistered = true; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override protected void onPause() { /* * Unregister BroadcastReceiver */ if (isRegistered) { this.unregisterReceiver(smsReceiver); isRegistered = false; } super.onPause(); } @Override protected void onDestroy() { /* * Unregister BroadcastReceiver */ if (isRegistered) { this.unregisterReceiver(smsReceiver); isRegistered = false; } super.onDestroy(); } } </code></pre>