Android Question Intents - Launch Application Question

chrisinky

Member
Licensed User
Longtime User
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:
Sample Code:
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!
 

chrisinky

Member
Licensed User
Longtime User
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.
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
Top