add this to manifest

<uses-permission android:name="android.permission.RECEIVE_SMS"></uses-
permission>


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

On Jan 9, 12:10 am, Honest <honestsucc...@gmail.com> wrote:
> On Jan 8, 5:52 pm, Honest <honestsucc...@gmail.com> wrote:
>
>
>
>
>
> > I have created one main class which extends activity. Another class
> > which extends BroadcastReceiver. The code of it is as below.
>
> > import android.app.NotificationManager;
> > import android.content.*;
> > import android.app.Notification;
> > import android.widget.*;
>
> > public class AlarmReceiver extends BroadcastReceiver{
> >     // Display an alert that we've received a message.
> >    // @Override
> >    ReceiveSMS sms=new ReceiveSMS();
>
> >     public void onReceive(Context context, Intent intent){
> >         System.out.println("Receive");
>
> >        NotificationManager nm = (NotificationManager)
> >         context.getSystemService(Context.NOTIFICATION_SERVICE);
> >        System.out.println("Message Received");
>
> >         Notification nm1=new Notification(R.drawable.ab,"Message
> > Received",1000);
> >         nm.notify(3, nm1);
> >         //nm.no
> >   //      sms.display();
>
> >    }
>
> > }
>
> > The following is my androidmanifiest.xml file.
>
> > <?xml version="1.0" encoding="utf-8"?>
> > <manifest xmlns:android="http://schemas.android.com/apk/res/android";
> >       package="com.android.ReceiveSMS"
> >       android:versionCode="1"
> >       android:versionName="1.0.0">
> >     <application android:icon="@drawable/icon" android:label="@string/
> > app_name">
>
> >             <intent-filter>
> >                 <action android:name="android.intent.action.MAIN" />
> >                 <category
> > android:name="android.intent.category.LAUNCHER" />
>
> >             </intent-filter>
>
> >         <activity android:name=".ReceiveSMS"
> >                   android:label="@string/app_name">
>
> >         </activity>
> >         <receiver android:name=".AlarmReceiver">
> >          </receiver>
> >     </application>
> > </manifest>
>
> > I did not get any error at the compilation time but when i run the
> > programme in eclipse . It does not get any user input. I thought that
> > it should invoked when i will send sms to that emulator but yet it
> > does not invoke. I hope some one will reply me as early as possible.
>
> Can some one help me or please give me prop[er place where i can put
> my query and can get reply. I did not get any reply from this google
> group . I put my 4 query here but no reply.- 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