I’m trying to make an android app that fires a background intent to “ping” a server with a post request about every 2 minutes (by default, interval is user-configurable). I absolutely need to avoid the service running when the phone is not in active use, and I need it to not defer the servic…
Tag: android-service
Error trying to launch service from non-activity class
I previously had a Foreground service that I launched from one activity. The code to launch the service was contained within said activity. Now I would like to launch this service with a non-activity class that can be called from different activities. In doing this I get an error: The working code block was p…
Implementing exit app button in the persistent notification
My app runs a background service indicated by the persistent notification. Users need to use the toggle button in MainActivity to turn on/off this service and thus to remove the persistent notification. Now I want to implement a notification action that can turn this service off & as well as the toggle wi…
Android service not working when app is closed
I’m having trouble with an android service that I’m doing. The service is about to get the location of the user every 5 minutes. All seems to go well except when i kill the app, the service won’t do nothing. In the code you will ses its checking every 60 seconds I think, but this will change…
How can I create a notification channel for Android API level < 26 (before Android Oreo)? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I am currently working with an Android service: https://developer.android.com/guide/componen…
Take a screenshot – Background Service
I’m trying to take a screenshot using a background service. This service is like a Facebook chathead, but I want it to take an screenshot when I do a click. I’ve developed some code but it doesn’t work. The last I’ve tried was: But is taking an screenshot to my button not to the screen…