Start Tracking Service externally

AntonK4 years ago

I'm implementing a kind of automation on my Android-phone (Android 6.0) with Automate app, and I want to start the Traccar Client service (Tracking Service) from corresponding controlling block.
Unfortunately this step fails with the exception:

java.lang.SecurityException: Not allowed to start service Intent { cmp=org.traccar.client/.TrackingService }
   without permission not exported from uid 10150

I guess, the service is marked as private. Can it be made public?

Is there any other way to start the service? Maybe with an intent?

Anton Tananaev4 years ago

Use shortcut intents instead.

AntonK4 years ago

Thanks a lot for quick reply!
I wasn't aware of the functionality with shortcuts.
Anyway it works great with one minor issue: the client doesn't see the service state change (or does it with significant delay), so the app should be restarted.
And the client window is brought to foreground, but that could be a side-effect of App start shortcut block.