Thanks Guys. Its working now.

So the process goes like this:
1. In your manifest file, make a activity and a receiver. Mention your
receiver class name here.
2. Make a entry for <uses-permission> android:name =
"android.permission.RECEIVE_SMS"
3. To test on emulator, test by DDMS perspective view.
4. You application will receive SMS while its dead too. in
Onreceive(), read the SMS and do whatever you want. you can also start
your activity from here.

Thanks
sam



On Mar 19, 7:56 am, Andreas <andreas.bex...@gmail.com> wrote:
> Hi,
>
> Please note that there is no longer any class called IntentReceiver.
> It is now called BroadcastReceiver. Also, to get this to work, you
> need to register the receiver in the AndroidManifest.xml like this:
>
>         <receiver android:name=".RespToSMS">
>                 <intent-filter>
>                         <action 
> android:name="android.provider.Telephony.SMS_RECEIVED" />
>                 </intent-filter>
>         </receiver>
>
> Regards,
> Andreas
>
> On Mar 18, 2:50 pm, Vaibhav Kulkarni <vaibhavkul...@gmail.com> wrote:
>
>
>
> > Hi Sam,
>
> > I think you should create a service for that!!! You can use Intent for SMS
> > in following way
>
> > public class RespToSMS extends IntentReceiver {
> >     /* package name for Intent */
> >     static final String ACTION =
> >          "android.provider.Telephony.SMS_RECEIVED";
>
> >     public void onReceiveIntent(Context context, Intent intent) {
> >      if (intent.getAction().equals(ACTION)) {
> >           StringBuilder buf = new StringBuilder();
> >          Bundle bundle = intent.getExtras();
> >           if (bundle != null) {
> >           SmsMessage[] messages =
> > Telephony.Sms.Intents.getMessagesFromIntent(intent);
> >           for (int i = 0; i &lt; messages.length; i++) {
> >               SmsMessage message = messages[i];
> >               buf.append(message.getDisplayMessageBody());
> >              /* Check your SMS format and respond here... */
> >           }
> >           }
> >           NotificationManager nm = (NotificationManager)
> > context.getSystemService(
> >               Context.NOTIFICATION_SERVICE);
>
> >           nm.notifyWithText(123, buf.toString(),
> >               NotificationManager.LENGTH_LONG, null);
>
> >       }
> >      }
>
> > }
>
> > Thanks,
> > Vaibhav
>
> > On Thu, Mar 18, 2010 at 10:33 AM, SAM <gulati...@gmail.com> wrote:
> > > Hi,
> > > I have a requirement to wake up my application upon receiving a
> > > particular formatted SMS or App directed notification from server.
>
> > > My application is in dead state. Whenever the device receives a event
> > > may be a SMS in a particular format OR some notification(eg app
> > > directed notification from server), android OS will start my
> > > application.
>
> > > Its possible in Windows Mobile and BREW.
>
> > > Please let me know if its possible in Android and how.
>
> > > Thanks
> > > Sam
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubs­cr...@googlegroups.com>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to