This object is in archive! 

API: Action task "track_record: action_after" malfunction

Michael Seery shared this problem 5 years ago
Solved

When using the API Action Tasks, I am able to start, stop, and pause track recording successfully. The problem is that when calling

tasks: { track_record: { action: "add_wpt", action_after: "audio" } }
there is no prompt to record audio, and no waypoint is saved, even if I hit the "save" button. I would expect that, after being prompted for the waypoint name, the audio recording dialog would appear. This is how it works when an audio waypoint is added via the GUI.


The behavior remains the same whether or not I specify the waypoint name, or set auto_save.


Attached is a demonstration, in the form of a Tasker configuration, that calls the "start" intent, then the "add_wpt" intent with action_after. "Start" works; "add_wpt" does not trigger the audio recording.

Replies (1)

photo
1

Good day Michael,

may you please write me how to import your config into tasker? Every from maybe 10 methods I found in tasker complains on the format, file ending or something similar. Thanks

photo
1

I reviewed the file format, and it seems good. It's possible Tasker didn't like the missing ".tsk.xml" in the filename, so attached is a version with that change. I was able to import it into Tasker as a Task (not a Profile, Scene, etc) by long-pressing on the "Tasks" tab and choosing "Import". Here is a more thorough walkthrough.


It's not all that important that Tasker is used to send the intent, as Locus should respond the same regardless of the sender. Tasker was just an easy way to prototype the API interaction I'm using.

photo
1

Thanks this helped. I know I can simulate the same system with usage for example Locus API sample app. Anyway, I wanted to have the same conditions as you have.

Problem is that Locus has the condition when saving waypoints that app (precisely one of it's activities) needs to be running in the foreground. Which does not happen here. If you run Locus Map in split-screen mode with tasker, you may test that it will work.

An app needs a valid activity context to correctly do this task you want. Anyway, I've lowered necessary conditions, so it will be enough in the next version, that Locus was at least started over icon. Not perfect, but definitely better as it may run in the background.

Let me know if the next version will work better. Thanks

photo
1

You were correct that split-screen does work as intended. I look forward to the next version and will let you know of any issue. Thank you Mr. Mlavec!

photo
2

I can verify that this issue is resolved in the latest version! Thank you!

photo
1

Perfect, thanks for confirmation.

Replies have been locked on this page!