821 questions
0
votes
0
answers
53
views
Foreground Service with two timers and double notification
I have a Foreground Service with two timers. I would like the timer number 2 to start when the timer 1 is paused, and I would like timer number 1 to resume when timer number 2 is stopped. Also, I ...
0
votes
1
answer
105
views
Android 16. foregroundService (specialUse) run by BOOT_COMPLETED throw android.app.ForegroundServiceStartNotAllowedException
I try start foreground service (FOREGROUND_SERVICE_SPECIAL_USE) for Android 16 by BOOT_COMPLETED and get android.app.ForegroundServiceStartNotAllowedException.
I know about boot restrictions, but ...
1
vote
0
answers
68
views
C.d.b -> Fatal Exception: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException
I keep facing the same error seen from Firebase Crashlytics.
Fatal Exception: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException
Context.startForegroundService() did not ...
0
votes
2
answers
90
views
Foreground Service: Where should I put the code I actually want to run?
I recently learned about Foreground Services in Android and how to use them.
Often what is used in examples is something like this:
class MyForegroundService : Service() {
...
override fun ...
0
votes
1
answer
104
views
Custom timer implemented as foreground service experiments delay after background
I want to implement just a simple timer which runs in background. For this purpose I have wrote it as a foreground service special use (its use does not fit the existent foreground services).
I ...
0
votes
0
answers
30
views
Android MediaRecorder creates .m4a file with no audio
I'm using Android Studio trying to record audio in an Android foreground service using MediaRecorder. The file is created successfully, but when I play it, it contains no audio. Here's the relevant ...
-1
votes
2
answers
56
views
Media3 is not starting foreground service
in my project i have an audio controller class
class AudioController(val context: Context){
private val player = ExoPlayer.Builder(context).build()
private val _state = MutableStateFlow(...
-1
votes
0
answers
42
views
Is it possible to use a BroadcastReceiver class to detect android.media.RINGER_MODE_CHANGED? [duplicate]
I'm writing an app which manages the ringer mode, but want it to be aware of changes to the ringer mode external to the app (e.g., by pressing the volume buttons and changing the mode there). I can ...
0
votes
0
answers
38
views
Android WebView LoadUrl is not waiting for another call to finish
I have a .net Android application (migrated from xamarin) and inside it there is a webView that displays a web app and also I have an Android Foreground Service that periodically is making a call to ...
0
votes
2
answers
51
views
How to send parameters between foreground service and view model
I have a foreground service that is used to launch a timer for a given object. I would like to:
Pass the object's id to the foreground service when the service is started and store it in the service ...
1
vote
1
answer
112
views
Android Wear OS: How do I open my activity or make a pop up notification, from my foreground service, when the screen is blacked out
I have an Android Wear OS emergency app, which monitors the user and looks out for emergency events. When the app is closed, I use a foreground service, to keep monitoring in the background. This ...
0
votes
0
answers
38
views
How to reliably listen to notifications in Android (without NotificationListenerService issues on MIUI devices)?
I'm working on an Android app where I rely on Google Calendar webhook notifications to sync calendar events. To listen to these incoming notifications, I'm currently using a ...
0
votes
3
answers
106
views
Implementing Android foreground service for device timer to update UI every minute
I am creating time tracking app in .net MAUI. And I want to run timer continues even app minimized so for that I am creating Android foreground service in MAUI. And it is work also but my issue is ...
1
vote
0
answers
98
views
How to fix Play Store warning: ForegroundService not allowed from BOOT_COMPLETED in Android 14/15?
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-...
0
votes
0
answers
47
views
How to start foreground service in Android 34
I build an Android application using Kotlin and Java. In this app I build some Service. Now with Android 12 I have no issue. From new device if I try to start this service, I receive the following ...
1
vote
0
answers
172
views
Getting SecurityException when starting foreground service with MediaProjection on Android 14+ (SDK 34)
I have a live app on the Play Store that recently started crashing on Android 15 devices with the following error:
Caused by java.lang.SecurityException
Starting FGS with type microphone callerApp=...
0
votes
0
answers
36
views
Endless Foreground Service or "How to receive PACKAGE_ADDED intent"?
I am trying to create app-install/app-update events logger and I have to manually register BroadcastReceiver intercepting android.intent.action.PACKAGE_ADDED to make it work.
In order to receive ...
1
vote
2
answers
316
views
Android 14: InvalidForegroundServiceTypeException when starting FGS with SYSTEM_EXEMPTED type
I’m seeing a repetitive crash in production when starting a foreground service from the background. The issue has occurred ~177K times in the last 30 days, mostly on Samsung devices (~50%) running ...
1
vote
0
answers
58
views
Why doesn't startActivity() launch UI after reboot via BroadcastReceiver + ForegroundService on Android 13 and above?
I’ve implemented a BOOT_COMPLETED BroadcastReceiver that starts a ForegroundService (BootService) after reboot. Inside the service, I use startActivity() to launch a fullscreen MainActivity (WebView-...
0
votes
0
answers
68
views
Audio Foreground Service getting stopped on app kill or detached when it should not
I'm building an Flutter Android foreground audio streaming service using ExoPlayer in Kotlin. The service plays live audio streams and shows media controls via a notification. It works fine while the ...
0
votes
0
answers
35
views
Foreground service notification (fg/bg state) activity launch decision problem
A foreground service is being launched upon a FCM event received by RN messaging().setBackgroundMessageHandler - @react-native-firebase/messaging which triggers a notification to display.
The JS side ...
0
votes
0
answers
28
views
updating multiple notifications each second in android doesn't work
I have a foreground service which is basically used for counting down from certain number.
As 1 foreground service can have only 1 notification, I show other notifications using notification manager, ...
0
votes
0
answers
237
views
How to start a FOREGROUND_SERVICE with microphone access in background on Android 14?
I'm developing a child safety app as a pet project.
On the parent's device, there's a map that shows the child's current location.
On the child's device, I run a background service that also includes ...
1
vote
2
answers
202
views
MAUI: Android: Foreground service is not running
I have integrated foreground service like below in my MAUI application.
MyForegroundService.cs under Platforms.Android
// MyForegroundService.cs
using Android.App;
using Android.Content;
using Android....
1
vote
0
answers
198
views
How to create Flet foreground service
I need help creating a foreground service in python-flet. Can anyone help me with advice or provide a procedure on how to create a foreground service using flet, python, pyjnius... and pyproject.toml ...
0
votes
1
answer
171
views
How to prevent crash when restarting android foreground service
I have a foreground service and I starts it by:
context.startForegroundService(Intent(context, MyForegroundService::class.java))
In the service, it uses START_STICKY
override fun onStartCommand(...
1
vote
0
answers
161
views
ForegroundServiceDidNotStartInTimeException in CoroutineWorker
Almost 200K users are experiencing the following crash in my Android app. The error is:
android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() ...
0
votes
0
answers
49
views
Foreground service auto-restarting on OnePlus 10R (OS 14) even when app is killed, not reproducible on Samsung devices
I'm experiencing unexpected behavior with a foreground service on OnePlus 10R (Android 14). The service restarts on its own even after the app is killed (swiped from recents). This does not happen on ...
0
votes
0
answers
24
views
how does FusedLocationProviderClient with callback handle doze mode and deep sleep
I'm working on an app whose main task is to send location data. I've found that using a callback with FusedLocationProviderClient and a foreground service works perfectly, regardless of the time ...
0
votes
0
answers
118
views
Android 15 - Foreground Service with Microphone Crashes After Long Background Running
I am developing an Android app that runs a foreground service to track location and record audio continuously on an Android 15 (Motorola) device.
The service works fine when started, but after ...
0
votes
0
answers
41
views
Start forground service in home widget
When I use the start foreground service in the home widget, I get the error ForegroundServiceStartNotAllowedException. And when I use start service, it runs without error. However, I need to use the ...
2
votes
0
answers
196
views
How to Automatically Launch an Application on Android TV Restart?
I am trying to automatically launch my application when an Android TV restarts. I have already implemented the following approaches, but none seem to work on API 34 (Android 14+) due to restrictions ...
0
votes
1
answer
61
views
Flutter ConnectyCube: Accepting Call from Notification Doesn't Redirect to App
Problem:
I'm using ConnectyCube in my Flutter app for handling video calls. When a call is initiated from one device to another and the receiving device is in the background, the call notification ...
1
vote
0
answers
97
views
Android Activity Recognition Service stops receiving updates after 15 hours (Foreground Service, WorkManager, BroadcastReceiver)
I am facing a problem with the android google activity recognisation service to detect user activity , When I install appplication it work just fine and I get udpate like still ,tilt , on foot , in ...
0
votes
0
answers
122
views
How to play audio, when my flutter app is terminated (Alarm application)
I am working on an alarm app which is created in flutter. I am using android_alarm_manager_plus, flutter_foreground_task, flutter_local_notifications as the major packages to implement core ...
0
votes
0
answers
47
views
How to Count Clicks or Screen Touches on an Underlying App from a Foreground App in Android?
I'm working on an Android project where I need to count the number of clicks or screen touches that occur on an underlying application, even when my app is running in the foreground.
Here's the ...
0
votes
0
answers
51
views
How to Implement Foreground & Background Services in React Native CLI (Latest Android SDK)?
I am working on a React Native CLI project and need to implement Android services, specifically Foreground and Background services. However, most of the tutorials I’ve found are outdated, and the ...
0
votes
1
answer
213
views
MediaSessionService destroyed after remove app from recent apps
I'm starting the service in onCreate in the Activity using startForegroundService for Android Oreo and above and using startService for lower, in service I used startForeground in Service by calling ...
1
vote
0
answers
211
views
Occasional crash: SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
There is a very, very low probability that my program will have the following crash:
java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo....
0
votes
1
answer
54
views
Let another App do critical NFC interactions while your App is actively used
Android Question
Requirements for MainApp:
Let's say I have an Android application (MainApp) that hosts an Activity with the following responsibilities:
Notifying another app (CriticalNfcApp) to ...
0
votes
1
answer
66
views
unexpected packages are slowing down the app - Android
I created a foreground sticky service, I am learning to develop android apps
The service is nothing but to print the time for every 5 sec and check the data from the server
when the service is running,...
4
votes
1
answer
226
views
Unexplained BadForegroundServiceNotificationException in Crashlytics logs with varying layout references
I'm encountering a crash in production that I cannot reproduce locally. The crash is logged in Crashlytics as follows:
Fatal Exception: android.app.RemoteServiceException$...
0
votes
1
answer
66
views
Do separate processes share a main thread?
I have an Android app with a few components, each set to run in their own processes:
The activities
A content provider
Foreground service
Accessibility service
I've noticed that heavy work being ...
0
votes
2
answers
94
views
Foreground service crash andorid 14
I'm getting this error
Starting FGS with type location callerApp=ProcessRecord{22f416f 27792:smartsense.co.in.sensephone:remote/u0a255} targetSDK=34 requires permissions: all of the permissions allOf=...
0
votes
0
answers
139
views
Unity - How to always keep application open in background
I am building an app where you can send and receive MQTT messages through topics. I am using unity and i have switched to android platform for this. My problem is that when i change app the code stop ...
0
votes
1
answer
127
views
Forever running Service for API 34+
I have been researching without results for some time now. A foreground service whose service is forever running needs to be created.
Idea can be found on this gist: https://gist.github.com/varunon9/...
1
vote
1
answer
800
views
[@notifee/react-native]: foregroundServiceType 0x000000C0 is not a subset of foregroundServiceType attribute 0x00000800 in service element of manifest
In a video conferencing app, I recently added a foreground service to my App's manifest because after the app is in background for about a minute, others in a call are not able to see or hear the ...
0
votes
1
answer
41
views
Xamarin background location service keeps crashing
I am trying to make a xamarin app, with android and ios.
I have made a service, to broadcast the users location at interval, but everytime it tries to broadcast (using SendLocationToServer() ) it ...
1
vote
1
answer
166
views
Headless JS task in React Native JS not running even though called from Native service
I'm trying to call Headless task triggered by CallScreeningService by passing the incoming number to Headless.js which handles the data. It also triggered foreground service for my RN app.
The log ...
0
votes
0
answers
87
views
What is the most effective method for periodically calling an API in the background?
I have application where I use TimeTask for counting timeFromLastOrderLoad.
val t: TimerTask = object : TimerTask() {
override fun run() {
timeFromLastOrderLoad += 1
...