Application error when determining coordinates

Hello! Please help me!
The task is as follows: you need to determine the GPS coordinates of my position. If you use this design:
1
it will work under one condition that GPS is enabled in the phone. But if GPS is turned off, the application will give an error, despite the fact that there is a check for gps activity.
2

Please tell me how to ensure that when gps is turned off, the application asks to turn on gps and there are no errors.

Tell me more. Where can I read a description of the use of all blocks? Interested in “screen1” blocks

Try using else if here instead of else

Use the same block and if GPS turned off means if it return false then you can give a dialog message that please turn on your GPS in order to use this application

It didn’t help. The “if” check doesn’t work.

Right Click on Google Maps.MyLocationEnabled block and then click on do it after connecting to companion and see if it’s returning true or false and try this by turning on and off GPS

That’s what I found out. This block
3
only checks whether the definition of “my location” is enabled, but! It does not determine at all whether GPS is enabled on the smartphone.
Therefore, if GPS is disabled on the smartphone, this block will still return TRUE. But when the order comes to execute this block:
4
if GPS is disabled, an error appears.
Question - is there a valid way to find out if GPS is enabled on your smartphone?

1 Like

Maybe this can help to find out wheather the GPS is on or off

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.