Get Lattitude Longitude and My current location

You must ask for permission to use the location first.

Needed permissions:

    android.permission.ACCESS_FINE_LOCATION
    android.permission.ACCESS_COARSE_LOCATION
    android.permission.ACCESS_MOCK_LOCATION
    android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
3 Likes

Thanks can you please share aia if possible

Sure, give me a second

No permission required, if they enable location service, immediatly you can get it by using google map which is inbuild in the kodular app

location.aia (2.1 KB)

Just use these two blocks to get lattitude and longitude

blocks(1) blocks

1 Like

Thanks I will try this

I will try this also

getlocationwhenGPSon.aia (2.0 KB)

This aia will give geo value immediatly but user need to enable GPS on but no need to ask any permission

2 Likes

not correct what if user does not move then the event will also not fire i prefer you the best use location sensor component or use the extension by @juananton1991

1 Like

Thanks for the aia

1 Like

It works well even if you are ideal in position or moving .
I have tested and still working fine in my school attendance app.

1 Like

this is not working values are coming as 0

You’ll have to wait a few seconds and refresh again as it says in the AIA

this worked thanks

thanks all of you for the replies

your welcome

Actually this blocks was sent by me …:thinking::thinking::thinking:

What worked? Please mark the original & exact post as the solution.

2 Likes