Location sensor not showing latitude and longitude

i want to show user their latitude and longitude but every time it shows lat = 0 and long = 0, Even if i turn on the GPS it takes about 30 seconds to show latitude and longitude

And then it shows the correct position?

The speed in which a location is found depends on if you only use GPS, only use Wifi or GPS and Wifi together.

If you only use GPS it also depends on where you are. In the open field is the best, but if you are moving in a car, are in the woods or in a city with a lot of highrises it will also take more time.

it only shows 0(zero) most of the times. i have checked it in different location with gps, wifi. how can i fix this problem

Show the blocks you used.

Screenshot%20(21)

Loation Sensor settings
Screenshot%20(22)

It doesn’t work that way. It needs time to get a fix. So putting it in initialize shows indeed a 0.

You have to use this block. When the location changes so when you get a first fix on your location you can put the latitude and longitude in the labels not before.

image

2 Likes

Screenshot%20(23)
Is This The Right Way?

Yep. Did you test it?

It Worked But It Takes About 10 Sec To Show That

That’s when he gets the first fix. So it can not be faster. Maybe depend on phone, gps, signalstrength, place where you are, etc, etc.

6 Likes