Tasker

MikeH8 years ago

Has anyone had any luck starting and stopping the traccar service with Tasker? If so can you share the actual task screen

Anton Tananaev8 years ago

You have to create shortcuts for starting and stopping service. Then just use those shortcuts in Tasker.

MikeH8 years ago

I tried that, those shortcuts don't show up in Tasker, would you be able to share the command line for those two options?

Anton Tananaev8 years ago

I don't have Tasker app, so I don't really know where to look for it, but there must be an option to call shortcuts. I don't know what you mean by "command line".

MikeH8 years ago

Sorry, is it the same executable that is used to start the service? If so, what additional data is passed to the executable so that it knows you're trying to start the service, as opposed to opening the user interface

Anton Tananaev8 years ago

Are you talking about Android? What do you mean by executable? There are no executable files, there are intents. Shortcuts to start/stop service have different intents than default launcher shortcut.

MikeH8 years ago

How are they different? That might alone answer the question. Yes, this is Android

Basically, how does the operating system call service start and the service exit, compared to starting the user interface

Anton Tananaev8 years ago

One starts MainActivity, the other one ShortcutActivity.

MikeH8 years ago

What about the Third? Isn't there are three possible courses of action: start the service, stop the service, and start the user interface?

Anton Tananaev8 years ago

Start and stop service - ShortcutActivity with a boolean flag (indicating start or stop)
User interface - MainActivity

MikeH8 years ago

Is the boolean true/false, or start/stop. Also is it stored in a particular variable (probably won't need the latter, but just in case)

Anton Tananaev8 years ago

It's passed with "shortcutAction" as a key. Boolean is always "true" or "false". There are no other options. In this particular case true means to start the service, false means to stop the service.

MikeH8 years ago

I'm testing now. If I get it I'll post the final product

MikeH8 years ago

This is what I'm currently trying without success. The UI loads (it doesn't need to) but is blank and the service doesn't start, I have to be missing something simple

MikeH8 years ago

Changed data to read shortcutAction:true but also to the same effect