The support forum is temporarily read-only. For urgent requests, please email contact[at]psyberia.net

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

Any question about the app? Ask it here
Post Reply
T2D
Posts: 20
Joined: Sun Jul 03, 2016 10:24 pm

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

Post 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).
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

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

Post 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
Do you like AlpineQuest ? Leave a small comment on Google Play !
T2D
Posts: 20
Joined: Sun Jul 03, 2016 10:24 pm

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

Post 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.
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

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

Post 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.
Do you like AlpineQuest ? Leave a small comment on Google Play !
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

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

Post 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
Do you like AlpineQuest ? Leave a small comment on Google Play !
Charles W.

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

Post 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.
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

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

Post 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
Do you like AlpineQuest ? Leave a small comment on Google Play !
Charles W.

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

Post by Charles W. »

Worked now.
Though I had already managed to make it work using Macrodoid.
Thanks!
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

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

Post 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).
Do you like AlpineQuest ? Leave a small comment on Google Play !
Post Reply