Hello Guys,

I am creating one notification based on some event. This notification
will only create sound. I just want to generate the sound using this
notification, but no UI.
Following is my code for this:
 // make notification sound whenever the device is connected or
disconnected
                        Notification notification = new Notification();
                        notification.defaults |= Notification.DEFAULT_SOUND;
                        notification.flags = Notification.FLAG_AUTO_CANCEL;
                        NotificationManager manager = (NotificationManager)
mContext.getSystemService(Context.NOTIFICATION_SERVICE);
                        // notify to all,
                        manager.notify(0, notification);

I am facing few problems and have some doubts. I tried to search for
answers in this post but could not find, so I am posting here for your
people's suggestions:
1. Here I am using 0 as id for the notification. Is it good in
practice. Since, I dont want to that this notification conflicts with
other.
2. I have one doubt, about notificaiton ids, e.g. if i keep my
notifications id as 1 and some other application also have set that as
1. In that case, will my notification be updated. or Android treats,
application's notifications differently.
3. Is it necessary to add FLAG_AUTO_CANCEL flag in my notification.
Because, I think this is used when notification will appear in the
status bar. But in my case, I have no UI. It means nothing will appear
in status bar.
4. Currently there is one problem. When my notification makes sound,
sometimes it seems that it is supressed or destorted by any other
sound or event. I am not sure what is happening there. So, If anyone
of you have some idea that will be helpful.

Await for your suggestions and help.

Thanks,

Suresh Pal

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

Reply via email to