Vladimir
Vladimir

Reputation: 1243

Alerting the user from a service (Android)

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?

Upvotes: 0

Views: 64

Answers (2)

Ovidiu Latcu
Ovidiu Latcu

Reputation: 72321

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).

Upvotes: 2

Till
Till

Reputation: 692

What you think of is called ´Notification´ in Android. You can find more information here on how to create some.

Upvotes: 0

Related Questions