421 questions
1
vote
1
answer
96
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 ...
1
vote
1
answer
388
views
Connect service with app via AIDL in AOSP
I'm trying to connect HAL service to the user app via AIDL. I've tried connecting app to service without luck. How to properly connect user app to HAL C++ service via AIDL? What am I doing wrong?
For ...
1
vote
0
answers
65
views
Plugin for Android Application is Unable to Locate Service
my team and I are working on a plugin for the Android app CivTAK. Plugins in the context of this application are treated as individual apps with just a Service and no Activity that are discovered by ...
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
166
views
Accessibility Permission revoke
After auto-updating the application, the accessibility permission is automatically revoked, even though it was already granted. The device's OS is Android 10. There are multiple devices on which my ...
0
votes
0
answers
137
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
87
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 ...
1
vote
0
answers
117
views
Android rebind to foreground service after configuration change
I have an app that starts a custom foreground service that keeps running even if the app is closed.
To do that, I start the service when the user touches a button in the UI and then I bind to it in ...
0
votes
2
answers
3k
views
How to use koin for Service
I was starting the foreground service by manually binding and then using its method.
However, I recently came across Koin and found https://insert-koin.io/docs/reference/koin-compose/compose
@...
2
votes
1
answer
66
views
What happens when i call stopSelf in onDestroy method?
I have such a method implementation and I want to understand what will happen when this method is called. Could you give me a hint
override fun onDestroy() {
Timber.d("$this: onDestroy&...
0
votes
1
answer
559
views
Unable to create service : Java.lang.ClassNotFoundException in Android
I have an Android application which uses a SDK library to send data. I packed the SDK library as .aar file and added the dependency in the App.
I'm trying to replicate the following exception in my ...
0
votes
0
answers
151
views
Why android has various types of service and is workManager an alternative to services
I'm learning Android and currently, I am dealing with the background stuff and came to know about two things services and workManager. Before I got started with any of the ones I got to know about ...
1
vote
1
answer
38
views
I'm trying to playmusic using service but it's not working
from here i started the service
Intent intent=new Intent(getActivity(),MyService.class);
s=sn;
u=ur;
intent.putExtra("uri",u);
ServiceConnection ...
0
votes
0
answers
39
views
Create button inside service
I want to ask for a solution from you guys, how do I create a button in the service then I can return the string value through the callback interface
2
votes
1
answer
5k
views
How to use service in jetpack compose
I want to use service in jetpack compose. I am trying to bind services in compose app but it always return null to me. I tried this stack overflow. But it didn't work to me. Anyone guide me on this ?
...
0
votes
1
answer
328
views
Custom Android service not found despite proper permissions and queries with SDK 33
In this project, I provide two example apps:
a "service app" providing a service like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package=&...
0
votes
1
answer
75
views
Never call unbindService() method on a Service?
I have scenario(for theoretical purposes):
What happens if, say, there is only one Activity that is bound to a Service and it decides to never call unbindService() method?
Will the Service ever get ...
1
vote
0
answers
228
views
How to send data to a REST API every minute from android using kotlin?
Assuming that I have implemented a SensorEventListener from which I generate the values deriving from the movement of the accelerometer of the device; that I have implemented the visualization in the ...
0
votes
1
answer
1k
views
How to send an initial message using ServiceConnection?
I have an android service, which is connected to a service connection. Upon initialization, I'd like to send a single String, for example "test message" to the Service connection. How would ...
3
votes
2
answers
2k
views
Service does not get started by bindService with BIND_AUTO_CREATE
I have a project with three mudules:
com.example.library - defines the AIDL interface
// IRemoteService.aidl
package com.example.library;
interface IRemoteService {
int add(int a,int b);
int ...
0
votes
0
answers
335
views
Can a client technically use a services binder after unbinding from the service?
Background: I have a few services (open for other apps to use) which run in the same process. The RPC is implemented using AIDL and therefore the services have to be open to multiple threads.
This ...
1
vote
1
answer
224
views
Does overriding Service.OnStartCommand put the service into the started state?
In the bound services documentation, it says
When a service is unbound from all clients, the Android system destroys it (unless it was also started with a startService() call). As such, you don't ...
0
votes
1
answer
1k
views
How to set action for previous and next controls in ExoPlayer?
I am making a audio player app. I created a service for audio player and playback notification. I am facing problem with the previous/next buttons in the Player as well as the playback notification.
...
2
votes
0
answers
367
views
Can a bound service start itself?
I have a service that is designed to run in the foreground and allow clients to bind to it. It is similar to a music foreground service (described here) that plays music and allows an app to bind to ...
3
votes
1
answer
246
views
Can a non-privileged Linux native executable in Android communicate with a regular application using Binder?
In order to test and control my regular android application, I wrote a command line Linux test program and used adb shell to execute this test program.
I can send a broadcast or start an activity to/...
0
votes
0
answers
592
views
How to prevent termination of main app when the service is in foreground?
I'm currently trying to remake our company app that has been outsourced. We do not have access to the source code so its not possible to look at the code. Our outsourced app has a service running in ...
0
votes
0
answers
1k
views
how to get instance of running accessibility service in android
I want to take a accessibility service instance and call there method in
Activity.
I tried taking
AccessibilityService as = new AccessibilityService ()
as.doSomething()
but this works for first time ...
3
votes
0
answers
726
views
Jetpack datastore not synchronised data between activity and service
Android application consist from visual part(activity) and bound service. Visual part is used to configure Service. Config is stored in Jetpack DataStore. Service read config on every client ...
1
vote
1
answer
631
views
Periodic HTTP requests in Android foreground service
This question is more about what tools to use not about exact code.
I have an android app that allows a user to define some tasks. Each task is related to periodical REST HTTP queries - let's say ...
1
vote
0
answers
1k
views
Android App Service with android:isolatedProcess="true" not working with intune SDK
Describe the bug:
I have an app which uses Intune SDK for android. We want to integrate a service with with android:isolatedProcess="true" for root detection related functionality on our App....
0
votes
2
answers
1k
views
Why Binders(used for IPC) even when activity and services are in the same process
Binders are used for Inter(not intra) Process Communication/Remote Method Invocation so why/how the communication between Activity and Service is possible via binders where there are no different ...
0
votes
0
answers
48
views
How to propertly send data to a long-time working service?
My app has a service that starts and stops independently of the main activity. The service can be considered to be running all the time.
I am looking for the correct way to pass data to this service. ...
1
vote
0
answers
508
views
On Android 11 setMediaSession on Notification then call stopSelf won't trigger onDestroy in MediaBrowserServiceCompat
I've tried to scope down the code as much as possible to identify the problem (although may have missed some pieces) but essentially I'm having an issue that occurs for Android 11 or higher where the ...
2
votes
0
answers
724
views
FirebaseMessagingService immediately destroyed after being created
I am using a BroadcastReceiver to send a broadcast to restart the FirebaseMessagingService when the service is destroyed. However, when starting service this way, the FirebaseMessagingService gets ...
0
votes
1
answer
2k
views
Properly unbind service from activity
I have a simple android app with an activity that binds a service. The basic code is like this:
public class MyActivity extends AppCompatActivity {
private MyService service;
private boolean ...
1
vote
0
answers
676
views
Confused about Android Telecom subsystem order of events on incoming calls
In the following link:
https://developer.android.com/guide/topics/connectivity/telecom/selfManaged
I see the quote
Use the addNewIncomingCall(PhoneAccountHandle, Bundle) method to
inform the telecom ...
1
vote
0
answers
30
views
Does a bounded service destroyed when all activites unbind it?
I am creating a separate thread in a android bounded service's onStartCommand() and running it using a condition check in Runnable's Run() e.g. while (condition), there is a activity which is using ...
6
votes
2
answers
2k
views
App isn't killed when removed from recent tasks when using service
First of all, this question is NOT about how I can prevent the app from being killed. Actually I want it to be killed.
Now the problem. My application connects to a BLE devices and I want the ...
0
votes
1
answer
219
views
Android: bind to remote service: crashes service
I'm trying to bind to a remote service of the Drozer test app (sieve), but I keep crashing this app with a NullPointerException, and I don't understand why.
The basic idea is to send a PIN code to the ...
1
vote
2
answers
822
views
Using startForeground Service not keeping after Activity destroyed
Currently, I need a bound (Music)Service, because I need to interact with it. But I also want it to not be stopped, even when all components have unbound themselves.
My service code:
class ...
1
vote
1
answer
1k
views
Android: How to communicate between an activity and a service that is running in a different process?
I am starting a service in a different process from an activity.
The service is designed to run even when the app is closed.
After starting the service from the activity, I close the app. Now when I ...
0
votes
1
answer
231
views
Determine the process name of a Manifest-registered Service
I have a client that binds a service.
This client should wait 5 seconds asynchronously to bind the service, unless the process that the service lives inis already alive.
To determine if the process is ...
0
votes
0
answers
25
views
Why do Android bound services load after Fragments?
My question is exactly as it says on the title. Why is it that Android bound services always load after a whole fragment lifecycle is complete? Bound services are meant to be loaded on the activity ...
0
votes
0
answers
245
views
Android bound service not destroyed after all clients unbind
I have 2 services A and B.
A creates B and binds to B via the Context#bindService() with the CONTEXT_AUTO_CREATE flag. Normally when A unbinds from B, B is destroyed. Under this approach, A and B are ...
1
vote
2
answers
2k
views
How to observe LiveData created by Service from UI/MainActivity/Fragments?
I have a service that updates data every now and then. I currently use sharedPreferences to store the data and use LocalBroadcast to communicate between the service and UI.
I would like to improve ...
0
votes
0
answers
394
views
Transfer Images using IPC app to app communication on the same device
I want to know if there is any efficient way to make app to app communication using IPC. I went to the guide of services that uses AIDL from the docs. But what I really want is to have an image to ...
1
vote
1
answer
999
views
Unable to bind isolated service in react native android application
Am trying to bind one service as an isolated process in my react native Android app
<service
android:name="com.xx.xx.services.IsolatedService"
android:...
0
votes
0
answers
344
views
How to start a service and then bind to it from a fragment
I have a TimerService that I'd like to bind to with a TimerFragment, so I can call the Service's methods and observe its LiveData in the fragment. The problem I'm running into is that when I start my ...
2
votes
3
answers
1k
views
Should I use a workmanager for an immediate work without showing notification
Let's say my application has several activities. When I come to the first activity, I will initiate an api call. User won't be blocked during this api call and can navigate to other activities during ...
0
votes
2
answers
1k
views
Binding exoplayer from service to activity not working?
Following is my service class
class LocalAudioService : Service() {
var player: SimpleExoPlayer? = null
private var playerNotificationManager: PlayerNotificationManager? = null
private ...