Page 1 of 1

[done] Suggestion: Interface with automation apps via Android intents.

Posted: Mon Jul 18, 2016 1:11 pm
by T2D
Suggestion: Create Android intents that can be used by automation apps. This can provide a voice-command interface to AQ.

An automation app, like Tasker, can transmit/receive intents which allows it to control/respond to other apps. This capability, along with a plugin like AutoVoice, can be used to develop a basic voice-command interface to AQ. There are probably other automation apps, besides Tasker/AutoVoice, that can do the same thing (like Automate).

For example, I can create a voice-command to "Set Waypoint." which sends an intent that is received by AQ. In response, it creates a waypoint at the current location (assuming GPS is on and if track-recording is on the waypoint becomes part of the track). This allows for hands-free waypoint creation. For this to happen, AQ needs to listen for the "set waypoint" intent.

Here's a more sophisticated example (although I'm not sure all automation apps can handle this one). "Tell me about the next waypoint." AQ receives the intent and broadcasts a reply containing the distance and bearing of the next waypoint. The automation app parses the values and uses text-to-voice to announce "Distance 350 meters. Bearing 135 magnetic."

This feature would appear be in Settings and can be enabled/disabled by the user (disabled by default since this feature adds processing overhead to AQ).

Re: Suggestion: Interface with automation apps via Android intents.

Posted: Wed Jul 20, 2016 8:08 pm
by Psyberia-Support
Hi and thanks for this suggestion.
This is an interesting feature, I'll see what I can do. The good things is that listening to intents doesn't cost anything, everything is handled by the the system, the application is just notified when a new intent (command) arrives.
I'll try to add basic function in the next version as a test.
Best regards

Re: Suggestion: Interface with automation apps via Android intents.

Posted: Fri Jul 22, 2016 3:42 pm
by T2D
Thanks!

Another use of intents would be to pause/restart/stop&save the Track Recorder.

By exposing some of AQ's internal operations with intents, I can use an automation app to listen for the intent and perform desired tasks. In other words, I can create custom functionality without you having to code it.

For example, if I want a custom message spoken when I arrive at a waypoint, this is easily done by an automation app once it receives a waypoint intent transmitted by AQ. Theoretically it could speak the waypoint's name.

Similarly, I can create a macro that sets Location services to High (GPS on), launches AQ, and instructs it to start the GPS and the Track Recorder, and then speak "Tracking Started". Tap one button and everything is ready to go. Alternately, you could create a widget to control the Track Recorder but intents give me more flexibility.


Disclaimer: I'm not an Android developer. I have no idea how difficult it is to implement this feature and ensure AQ remains the stable, highly-functional product that it is.

Re: Suggestion: Interface with automation apps via Android intents.

Posted: Mon Aug 15, 2016 10:03 am
by Psyberia-Support
Just an update, I've added an Intent to create a waypoint (I make my tests with Automate) and it works great.
I'm waiting to add more controls (like the location tracker) to publish a beta update (I'll keep you updated).
Sorry for the delay.

Re: Suggestion: Interface with automation apps via Android intents.

Posted: Thu Sep 08, 2016 5:17 pm
by Psyberia-Support
Hi again,
I've released a beta of AlpineQuest with this feature. You can get this version from Google Play as explained here.

There are not much actions for now, but I can add some more on request:
  • "psyberia.alpinequest.free.intent.action.LANDMARKS_FAST_WAYPOINT": Add a regular waypoint. You can add a String extra called "name" to specify a name;
  • "psyberia.alpinequest.free.intent.action.TRACKER_START": Start the track recorder;
  • "psyberia.alpinequest.free.intent.action.TRACKER_ADD_WAYPOINT": Add a waypoint to the track recorder. You can add a String extra called "name" to specify a name;
  • "psyberia.alpinequest.free.intent.action.TRACKER_PAUSE": Pause the track recorder;
  • "psyberia.alpinequest.free.intent.action.APP_STOP": Close the application.
I've successfully tested these command using the "Tasker" (free) app. Don't hesitate if you have any comment or issue.
Best regards

Re: Suggestion: Interface with automation apps via Android intents.

Posted: Sat Jan 06, 2018 2:41 am
by Charles W.
Psyberia-Support:

Using the Automate app and following the instructions above, I've managed to automate the placing of a waypoint in Offline Maps using the "net.psyberia.offlinemaps.LANDMARKS_FAST_WAYPOINT" intent. However, I couldn't manage to specify a name by adding the "name" extra, probably because of a syntax error, since I'm not an advanced user (sorry for the newbieness, by the way).
You posted above that you tested the intent feature with Automate, so I was hoping I could get some help.
Here's what I did:
I placed an input dialog block prompting me to type the desired place name, which outputs to a variable called placeName. In sequence I placed the App start block wich launches the intent, typing in the extras field

"name" = placeName

but it didn't work, as the waypoint is placed sucessfully but the name is not. I've also tried several variations of the expression above, none of them worked.
Hope you can help me. Thanks a lot.

Re: Suggestion: Interface with automation apps via Android intents.

Posted: Wed Jan 10, 2018 10:38 am
by Psyberia-Support
Hi Charles,
Don't be sorry for the "newbieness". You're playing with poorly (if not at all) documented features, and I apologize for this. Moreover before mastering any tool we all are newbies at some points!
As soon as I find some time I'll try to write an help page about external controls in general.

For your particular problem, Automate as a particular way to fill "extras".
Here is what I did put in the "EXTRAS" field of the Automate intent:

Code: Select all

{"name": "placeName"}
Please let me know if you need any more details.
Best regards

Re: Suggestion: Interface with automation apps via Android intents.

Posted: Tue Jan 23, 2018 12:41 pm
by Charles W.
Worked now.
Though I had already managed to make it work using Macrodoid.
Thanks!

Re: [done] Suggestion: Interface with automation apps via Android intents.

Posted: Tue Apr 28, 2020 1:20 pm
by Psyberia-Support
For information, there is now an help page on all intents here: https://www.alpinequest.net/en/help/v2/intents (as of version 2.2.5).