So, i have a service working in the background (when the application is closed) which connects to internet every 2 minutes and gets some data from a database, and if something's wrong i want to alert the user with some kind of a beep tone and a message on the screen or even better in the notification bar. Is it possible to do this and if yes, how?
Asked
Active
Viewed 61 times
2 Answers
2
I think the nicest solution would be to use a SystemBar
Notification
.
Using the Notification.Builder
you can add a custom sound to your notification using setSound(Uri sound)
.

Ovidiu Latcu
- 71,607
- 15
- 76
- 84
-
thanks, so is this how you create a notification: Notification noti = new Notification.Builder(mContext) ? – Vladimir Dec 09 '12 at 13:26
-
yeah, and then use the `NotificationManager` to add it to the SystemBar – Ovidiu Latcu Dec 09 '12 at 13:30