How to calculate distance

Post your questions and help other users.

Moderator: Martin

Post Reply
pilusona
Posts: 39
Joined: 02 Dec 2012 03:47
Location: India

How to calculate distance

Post by pilusona » 17 May 2013 18:04

Hi,
How to calculate distance between two locations? I can calculate the distance of two Locations using distance function. But the thing is that it takes two Location objects, one of them can be found using InitVariableLocation but the other one?

Thanks and regards,
Samsung Galaxy Note 8
Android 9.
Non-rooted

plm
Posts: 19
Joined: 06 May 2013 22:27

Re: How to calculate distance

Post by plm » 21 May 2013 14:05

I include a flow that does the job...
keep in mind, however, that it is only a "proof of concept": needs to be (higly) improved by adding, for example, error handling, lack of connection, the inability to calculate a position, etc.. I hope this can be helpful to develop your own flow, better organized and more efficient. You can test it inside Automagic or creating a Toggle Widget that toggle a global variable called global_distance
Best.
Attachments
Distance.xml
(3.56 KiB) Downloaded 911 times

pilusona
Posts: 39
Joined: 02 Dec 2012 03:47
Location: India

Re: How to calculate distance

Post by pilusona » 23 May 2013 19:06

Hi plm,

Thanks for your reply. I have not used your flow instead I have downloaded the XML and taken the logic from your flow, and it is working perfectly.

Thanks and regards,
pilusona
Samsung Galaxy Note 8
Android 9.
Non-rooted

plm
Posts: 19
Joined: 06 May 2013 22:27

Re: How to calculate distance

Post by plm » 23 May 2013 19:22

pilusona wrote:Hi plm,

Thanks for your reply. I have not used your flow instead I have downloaded the XML and taken the logic from your flow, and it is working perfectly.

Thanks and regards,
pilusona
Thank you, very kind. You have done well, the flow was not written as "running release" but just to show the logic (one of those possible) with which to achieve the purpose.
Best regards.

Post Reply