6,712 questions
0
votes
0
answers
112
views
How can I ensure that a continuous 24/7 health-monitoring service on Wear OS remains running?
I am working on a Wear OS app, which monitors the users data 24/7. The app is made for Samsung devices as part of a study. The data includes some health data and location data. My current setup works ...
Best practices
0
votes
1
replies
48
views
Same Room db from Remote Service and Activity
I wonder if it is okay to use the same Room db in Activity and Remote Service.
Since the Service is remote it resides in a separate process. Is it okay to open the same sqlite db file simultaneously ...
0
votes
1
answer
98
views
FirebaseMessagingService Cancels CoroutineScope Before the Job is Finished
In the following code snippet, I'm trying to execute a suspend function MessageHandler.handleMessage() in onMessageReceived(), however the function doesn't finish becuase the ioScope is canceled due ...
Best practices
0
votes
0
replies
56
views
How to fix FGS Security Exception crash in Foreground service (including Android Auto CarAppService)
I am facing a FGS Security Exception for few services in my Android app. Although I am not able reproduce it but the crash get logged for some users on crashlytics.
My Foreground service is of type ...
0
votes
2
answers
131
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
71
views
Flutter service starting on bootup receiver but not calling flutter app
I'm developing a flutter app blocker. The idea is simple: the user opens a monitored app and then is redirected to a screen on my app. The screen has multiple controllers so I'm making it in flutter ...
0
votes
1
answer
96
views
What is the correct way to send continuous data from a Foreground Service to a ViewModel?
I'm implementing a foreground service in Android (Kotlin) that handles GPS tracking. The service continuously calculates and must expose these values: Distance traveled, elapsed duration, current ...
1
vote
1
answer
153
views
Capturing the camera on android in the background with preview after processing with OpenCV
My goal is to be able actively process an image in the background, but when the app is in the foreground I'd need a preview which shows the processed image, meaning the original frame and bounding ...
0
votes
1
answer
94
views
Projected screen using Media Projection API is not showing on a surface view overlay in android studio
I'm developing an app that records the screen using the Media Projection API and transmit the data to an overlay surface view, however, the surface view and overlay components are visible but the ...
1
vote
0
answers
223
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-...
1
vote
1
answer
85
views
If the app offering the bound service is not running, can external components still use it? Does the app need to be running?
I've read that maybe I should declare <service android:enabled="true" ... /> or android:exported="true" in Manifest.xml, or I should use pass BIND_AUTO_CREATE to bindService()...
0
votes
1
answer
88
views
Overriding the app's default language - starting the app from the background causes localization issues
So my app has multiple languages:
Currently I set Polish, and English is system default.
App's build.gradle.kts:
android {
androidResources {
generateLocaleConfig = true
}
...
}
...
0
votes
0
answers
51
views
Why is the NotificationListenerService stops receiving notifications after the screen is turned off
I added some logs in the NotificationListenerService service:
class NotificationListenerService : NotificationListenerService() {
override fun onDestroy() {
logi("on Destroy")
...
1
vote
1
answer
195
views
Playing media in the background and stop it when needed
I want to create an activity that includes an androidx.media3.ui.PlayerView. The player should play a video using a foreground service, allowing media playback to continue even when the app is ...
0
votes
0
answers
38
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, ...