How to make Background-Running Services

Hey Guys,
I developed a few android-applications now. But i don’t know how to make an App, that can run in Background, when it’s not opened in foreground. Like a counter in the background, that send’s the user a message, when a chest is available or something like that.
Does anyone of you, know to do that, if it is possible?

Thank you :slight_smile: - Your Brotis