Enable location on android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
BigameOver
Posts: 39
Joined: Thu Jan 23, 2020 5:56 pm

Enable location on android

Post by BigameOver » Thu Feb 11, 2021 5:33 pm

Hi,
I created an app where I need to track my user's location and return them where they are.
After the users accept all the required premissions for location tracking I can get their location only if their location option in their phone is enabled.
I want to ask them to enable the location option in their phone like the image in the attachments.
Thank you
Attachments
Loction asking.jpeg
Last edited by BigameOver on Sat Feb 13, 2021 9:53 pm, edited 1 time in total.

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm
Location: down under

Re: Enable location on android

Post by liveme » Thu Feb 11, 2021 10:20 pm

if you want to know how to open this type of window..;maybe this helps...

https://lessons.livecode.com/m/4071/l/1 ... dal-dialog

if you want tosend the user to their Android Setting page for the location enable/disable....this I dont know how its done !
8)

Looks like Google - as Apple - is going to restrict coders more and more ...from using this feature without the user consent. :|

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: Enable location on android

Post by SparkOut » Thu Feb 11, 2021 10:45 pm

In the standalone settings, you will need to ensure that the correct options are chosen to include location with all its coarse and accurate choices.
This should ensure that when installing the app, the user is aware of the required permissions, but that doesn't mean that they can't install even if they leave the location service globslly disabled in the device settings.
In your spp you can check whether mobileSensorAvailable("location")  returns true or false. If true, you can start using the tracking sensor, or if false, pop up your notification asking the user to enable location choice in the device settings.

Post Reply

Return to “Android Deployment”