6,711 questions
0
votes
2
answers
84
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
54
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 ...
0
votes
1
answer
57
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
1
answer
51
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
0
answers
30
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")
...
0
votes
0
answers
27
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
1
answer
58
views
Process is not killed even after swiping off from the recents section
I am working on a bluetooth Android application to read data from a device.
Issue: When I kill the app by swiping it up from recents in Samsung, the process is not killed. I checked in Running ...
0
votes
1
answer
77
views
Access android device camera into a service
I am stuck into a problem programming an android application, using Java. I am implementing a Service, since my application should run in background, without affecting the other functionalities of the ...
-1
votes
1
answer
44
views
android implement expire duration change using countdown timer even when app in background
I have an e commerce app in which I have a list of elements which comes from backend, each item has its expiration duration like (5 minutes) for showing discount.
Each time I call api, it sends me ...
0
votes
0
answers
49
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
80
views
Start another application from a service in Android 11
I'm developing some applications with kotlin that will communicate with each other. This case affects 2 of those applications: a service and an application to play videos. The development is for a ...
0
votes
0
answers
44
views
No custom broadcasts are received on an android service
I'm developing some apps for a specific device running Android 11 (API level 30) in kotlin. I have 2 apps that need to communicate with each other and I have thought to do it using custom broadcasts. ...
0
votes
1
answer
100
views
Text display in random position in all other activities of app, by triggering from one activity
I have Main, Home activities are there Launcher app side (.apk). PlayActivity, Profile, and Init are there on the library side (.aar)
from the server side 1 message will trigger, then I want to show ...
1
vote
0
answers
355
views
Flutter app crashes: Context.startForegroundService() did not then call Service.startForeground()
I am using flutter background service to run a beacon scan in the background and in the foreground when the app is disconnected.
I get the folowing response when the app crashes. The app only occurs ...
0
votes
0
answers
28
views
Have Activity and Service observe the same flow
I have an Activity and a Service who both use the Room database data.
I have the following code for observing changes to the data:
viewModelScope.launch(Dispatchers.IO) {
repository.read().flowOn(...
1
vote
0
answers
41
views
Android can not start Service with ForegroundServiceStartNotAllowedException
I have a Service called ServiceTechnicianTrackingService that tracks location with foreground notification of the people using phone.
public class ServiceTechnicianTrackingService extends Service {
...
1
vote
0
answers
205
views
In Android 15 can a Device Admin App start a service from the background
With the recent changes in Android 15 where there are even more restrictions on starting services from the background I have not seen if device admin apps are part of this restriction.
Before I would ...
1
vote
0
answers
81
views
Broadcast between Service and Activity does not work with NOT_EXPORTED flag
I want to send and receive Broadcast between Service and Activity.
I registered programmatically created BroadcastReceiver both in Service and Activity with using flag RECEIVER_NOT_EXPORTED for make ...
1
vote
0
answers
116
views
How to startActivityAndCollapse(PendingIntent) from quick settings on locked screen of Android 14?
I want to show an activity when the users taps on a quick settings tile while the screen is locked. This works as expected using the startActivityAndCollapse method taking Intent as parameter (...
1
vote
0
answers
228
views
Android Codec2 component store service crashes while stopping the service
I am debugging a crash issue reported in the Android Codec2 integration of an audio decoder. The decoder component starts as a lazy service. Please see the source code below,
int main()
{
ALOGE(&...
0
votes
1
answer
92
views
my app does not send the notifications in scheduling on android studio
I've been working on this project for a few days, and either it sends a notification at the moment I schedule it or never. As it stands right now, it creates the channel and the notification, but it ...
0
votes
0
answers
133
views
Binding to a DeviceAdminService and calling its methods
I have a device admin app that is the device owner and I want to bind to the DeviceAdminService class that the admin app has from another app.
The problem is that the DeviceAdminService class has ...
0
votes
0
answers
34
views
Flag in android service changed for another companion object
I have an aidl interface in the client and server applications with which I connect from the Client application to the AIDLApiService service of my Server application. I call 2 methods on the ...
3
votes
1
answer
4k
views
My Foreground service is crashing on Android 14
I am implementing an android application with a service that is returning the location so , i have set the attribute foregroundServiceType to "location". Here is my service in the manifest ...
0
votes
0
answers
85
views
onServiceConnected not called but context#bindService return true
I am experiencing an issue where the onServiceConnected callback is not invoked in my client code, despite the service's onCreate and onBind methods being called successfully and return a binder. The ...