Hi All,
I am having some difficulty getting some of the commands/functions to work for android. So far I can't get any socket functions to work although I have had them working extensively in a live application for over two years. I will have to do some more work on that before I can say that I am stuck.
My main problem at the moment is trying to find out the current geo location data. Can someone tell me if there is something wrong with the following?
In card script....
on openCard
if the environment is "mobile" then
mobileStartTrackingSensor "location"
end if
end openCard
on closeCard
if the environment is "mobile" then
mobileStopTrackingSensor "location"
end if
end closeCard
In a button script....
on mouseUp
if the environment is not "mobile" then
beep
answer "Sorry, mobile only!"
exit mouseUp
end if
if mobileCanTrackLocation() is "true" then
answer "The location can be tracked"
else
answer "The location CANNOT be tracked"
exit mouseUp
end if
put "" into field "fldGeoData"
I get the message "The location CANNOT be tracked" and absolutely nothing else happens and I get nothing into the data field. I am using android version 6.
Has anyone else been able to get this stuff to work on android?
Regards,
Geoff Macumber.
mobileCurrentLocation()
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 30
- Joined: Tue Aug 12, 2014 7:15 am
- Location: Australia
- Contact:
-
- Livecode Staff Member
- Posts: 818
- Joined: Fri Feb 06, 2015 4:03 pm
Re: mobileCurrentLocation()
Hi Geoff,
Just a guess: Have you enabled the location-related permissions in Standalone Application Settings (for Android)?
Make sure "Fine Location" and "Coarse Location" are enabled.
Best,
Panos
--
PS: You might also need the "Internet" permission.
Just a guess: Have you enabled the location-related permissions in Standalone Application Settings (for Android)?
Make sure "Fine Location" and "Coarse Location" are enabled.
Best,
Panos
--
PS: You might also need the "Internet" permission.
-
- Posts: 30
- Joined: Tue Aug 12, 2014 7:15 am
- Location: Australia
- Contact:
Re: mobileCurrentLocation()
Hi Panos,
You are a genius! Thank you for that.
This is my first foray into all things mobile and I am having almost as much frustration with it as I did when I first started using LiveCode.
On another note, where can I find documentation on the settings for stand alone application deployment for android and iOS. The documentation includes the screens and settings for all deployments except these two.
Also if you can give me a clue as to why my socket code (which has been running unchanged for two years on windows) doesn't work. Are there any settings that affect it?
Again, thanks a million!
Regards,
Geoff Macumber
You are a genius! Thank you for that.
This is my first foray into all things mobile and I am having almost as much frustration with it as I did when I first started using LiveCode.
On another note, where can I find documentation on the settings for stand alone application deployment for android and iOS. The documentation includes the screens and settings for all deployments except these two.
Also if you can give me a clue as to why my socket code (which has been running unchanged for two years on windows) doesn't work. Are there any settings that affect it?
Again, thanks a million!
Regards,
Geoff Macumber
-
- Livecode Staff Member
- Posts: 818
- Joined: Fri Feb 06, 2015 4:03 pm
Re: mobileCurrentLocation()
Hi Geoff,
You are welcome. You can have a look at this lesson, which includes info about the Standalone Settings for every platform, including iOS and Android:
http://lessons.livecode.com/m/4603/l/68 ... n-settings
Regarding your sockets code, this is trickier to guess I *think* "Internet" permission is required on Android for sockets.
Best,
Panos
--
You are welcome. You can have a look at this lesson, which includes info about the Standalone Settings for every platform, including iOS and Android:
http://lessons.livecode.com/m/4603/l/68 ... n-settings
Regarding your sockets code, this is trickier to guess I *think* "Internet" permission is required on Android for sockets.
Best,
Panos
--
-
- Posts: 30
- Joined: Tue Aug 12, 2014 7:15 am
- Location: Australia
- Contact:
Re: mobileCurrentLocation()
Once again, thanks Panos.