C chrisinky Member Licensed User Longtime User Apr 18, 2022 #1 Hi, I need to launch an app thats a service, in "monitor" mode when my app starts. I can launch it, but it starts in debug no matter what I try. here is the android code of what I need to replicate, but am having trouble with, in B4A: Code: Copy Intent intent = new Intent("com.five_ten_sg.connectbot.monitor.MonitorService"); intent.setPackage("com.five_ten_sg.connectbot.monitor"); parent.bindService(intent, monitor_connection, Context.BIND_AUTO_CREATE); This is the output from Log(pm.GetApplicationIntent("com.five_ten_sg.connectbot.monitor.MonitorService")): (Intent) Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.five_ten_sg.connectbot.monitor cmp=com.five_ten_sg.connectbot.monitor/.MonitorActivity } Thanks!
Hi, I need to launch an app thats a service, in "monitor" mode when my app starts. I can launch it, but it starts in debug no matter what I try. here is the android code of what I need to replicate, but am having trouble with, in B4A: Code: Copy Intent intent = new Intent("com.five_ten_sg.connectbot.monitor.MonitorService"); intent.setPackage("com.five_ten_sg.connectbot.monitor"); parent.bindService(intent, monitor_connection, Context.BIND_AUTO_CREATE); This is the output from Log(pm.GetApplicationIntent("com.five_ten_sg.connectbot.monitor.MonitorService")): (Intent) Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.five_ten_sg.connectbot.monitor cmp=com.five_ten_sg.connectbot.monitor/.MonitorActivity } Thanks!
Erel B4X founder Staff member Licensed User Longtime User Apr 19, 2022 #2 The difficult part here is the "monitor_connection". You need to implement the ServiceConnection interface. You will not be able to interact with the service without it. Upvote 0
The difficult part here is the "monitor_connection". You need to implement the ServiceConnection interface. You will not be able to interact with the service without it.
C chrisinky Member Licensed User Longtime User Apr 19, 2022 #3 Erel said: The difficult part here is the "monitor_connection". You need to implement the ServiceConnection interface. You will not be able to interact with the service without it. Click to expand... Currently the 3rd party app launches, but it launches OVER my app. I then open a port on TCP 6000 to talk to that app and it succeeds. When I close my connection to the port, the 3rd party app closes as it should. I just need the app to launch as a service icon in the notification bar and not with it's GUI over mine - is that possible? Upvote 0
Erel said: The difficult part here is the "monitor_connection". You need to implement the ServiceConnection interface. You will not be able to interact with the service without it. Click to expand... Currently the 3rd party app launches, but it launches OVER my app. I then open a port on TCP 6000 to talk to that app and it succeeds. When I close my connection to the port, the 3rd party app closes as it should. I just need the app to launch as a service icon in the notification bar and not with it's GUI over mine - is that possible?
Erel B4X founder Staff member Licensed User Longtime User Apr 20, 2022 #4 chrisinky said: I just need the app to launch as a service icon in the notification bar and not with it's GUI over mine - is that possible? Click to expand... It is not something that you can control unless the other app provides such configuration. Upvote 0
chrisinky said: I just need the app to launch as a service icon in the notification bar and not with it's GUI over mine - is that possible? Click to expand... It is not something that you can control unless the other app provides such configuration.
C chrisinky Member Licensed User Longtime User Apr 20, 2022 #5 Erel said: It is not something that you can control unless the other app provides such configuration. Click to expand... I believe that the intent monitor_service would launch it that way, but I'm having trouble launching it in that manner... Upvote 0
Erel said: It is not something that you can control unless the other app provides such configuration. Click to expand... I believe that the intent monitor_service would launch it that way, but I'm having trouble launching it in that manner...