Help with Http request and location

Post your questions and help other users.

Moderator: Martin

Post Reply
seventech
Posts: 5
Joined: 17 Nov 2019 14:25

Help with Http request and location

Post by seventech » 09 Jan 2020 03:20

Hi friends.

I'm totally noob and without experience in Automagic.

O try to make one flow with:

Trigger - Http Request - Ok !
Action - Init Variable Location - New Location - Ok !
Action - Http Response Text with {location,locationformat}; but in this last action I wonder to get in Http response text the location in format link to open directly in Google Maps ... It's possible ?

Anybody can help me ?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Help with Http request and location

Post by Desmanto » 09 Jan 2020 05:16

What is the purpose of the flow? I see two. One is opening the location on the same device. HTTP request trigger is so you can use http to this device. The init location and open the location in google map on the same device, can be done just by launching the google maps itself. No need for the init location anymore.

But if what you want is you can use device A to http post to device B. Then device B init the location and response back the location thru the http response to device A. Then device A use this coordinate and open in google map. This mean at device A, after the action HTTP request to device B; once you got the response, use action Start Activity, click the examples and choose Google Maps: with coordinates. Replace the Data Uri part with the location, assuming your coordinate is stored in {location}.

Code: Select all

geo:{location,locationformat}?z=13
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

seventech
Posts: 5
Joined: 17 Nov 2019 14:25

Re: Help with Http request and location

Post by seventech » 10 Jan 2020 03:01

Not understand,phone A will assume Variable location after Http response ?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Help with Http request and location

Post by Desmanto » 10 Jan 2020 07:22

So you want the second scenario. At device B, you need to put action Write http response text. At the field, replace all the text with just {location,locationformat}
This will make device B return the response of its location to device A. Device A will get the response in {response}. You can directly use this without formatting again, since at B already show it in locationformat.
Just use it in the Data uri field

Code: Select all

geo:{response}?z=13
If you got error, use condition debug dialog to trace the error.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

seventech
Posts: 5
Joined: 17 Nov 2019 14:25

Re: Help with Http request and location

Post by seventech » 10 Jan 2020 11:27

Wow. Works perfectly. Thank you very much!!!

Post Reply