Page 1 of 1

mobileCurrentLocation() not working on android

Posted: Tue Jan 05, 2021 3:09 pm
by BigameOver
Hi,
I am trying to get the current location from an android device using mobileCurrentLocation(), but it seems it returns empty.

Code: Select all

mobileSensorAvailable("location")
mobileStartTrackingSensor "location"
put mobileCurrentLocation() into theLocation
When I try to answer the result, i get nothing.
What can I do?
thank you,
BigameOver

Re: mobileCurrentLocation() not working on android

Posted: Wed Jan 06, 2021 6:21 am
by strongbow
It returns an array so check the keys and values of each, perhaps using an arrayToText function.

HTH

Re: mobileCurrentLocation() not working on android

Posted: Wed Jan 06, 2021 10:52 am
by BigameOver
strongbow wrote:
Wed Jan 06, 2021 6:21 am
It returns an array so check the keys and values of each, perhaps using an arrayToText function.

HTH
At first I thought I should do like this

Code: Select all

answer theLocation[1]
I thought it works with only numbers. But now I understand where was my mistake

Code: Select all

answer theLocation[latitude]
Thank you

Re: mobileCurrentLocation() not working on android

Posted: Wed Jan 06, 2021 12:04 pm
by SparkOut
Quote the literal string for the keys as well :)

Code: Select all

answer theLocation["latitude"]

Re: mobileCurrentLocation() not working on android

Posted: Wed Jan 06, 2021 12:11 pm
by Klaus
And consult the dictionary if in doubt! 8)