I have the following case:
- get the current location at the click of a button
- get current location each x seconds
I’ve tried to use
FusedLocationProviderClient but I think I might not use the best approach. The thing is that I’d like - if possible - to call a method
getLocation() that will return the location. I’d rather not implement a service or something else. Is there anything like this?
LE: I want to point out that I am using Kotlin and Coroutines in my implementation.
So I came across this. I guess this might be a solution, but I’d like to hear your opinion on this.