Android Question [Solved] How to start service from other App

Creideiki

Active Member
Licensed User
Longtime User
How can I start a service from another app?
Tasker has a setting to send an intent to a specific service... but what have I to do in B4A to enable that?
Or what parameters I have to set to find the right service?

The logfile tells me
B4X:
Unable to start service Intent { act=de.helmutbender.intenttest.TEST dat=helmut://pling cmp=de.helmutbender.intenttest/targetservice } U=0: not found
 

DonManfred

Expert
Licensed User
Longtime User
How can I start a service from another app?
You can´t!

but what have I to do in B4A to enable that?
You need to implement a intent which your app can get. Once your app get this intent it starts the desired service.

So what you are asking about? How another app can start a service in YOUR app?
Or do you want to start a service from another app?
 
Upvote 0

Creideiki

Active Member
Licensed User
Longtime User
Tasker has the ability to send intents. There is an option to send it as broadcast oder to start an activity or a service with it.
The broadcast intents I know a bit (though I still didn't manage to setup Tasker correctly to get it working with Android 10), and I know it is possible to start an activity of another app somehow, but I don't know how that would work with services...
 
Upvote 0

Creideiki

Active Member
Licensed User
Longtime User
Yesss!
SetServiceAttribute did the trick.

I read this post before but didn't realize the difference (SetServiceAttribute instead SetReceiverAttribute).
In Tasker you have to put your packetname in Package ("de.helmutbender.setstatus" in my case) and the servicename with packetname in Class ("de.helmutbender.setstatus.websend" in my case). And you certainly have to set Target to "Service".

Now I can control my app with Tasker even with Android 10. Thank you very much!

BTW: Is there a documentation anywhere, where I can read about entries in the Manifest and what can be done with them?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…