How to receive location updates every 5 minutes using the FusedLocation API

后端 未结 2 1660
花落未央
花落未央 2021-02-06 18:14

I am currently working on an app that has to check the user\'s location every five minutes and send the coordinates to a server. I decided to go with the FusedLocation API in Go

2条回答
  •  离开以前
    2021-02-06 18:47

    About your first method where u are using the Activity to request for location updates, they should not stop unless you disconnect the Location Client in the onPause() method of the activity. So as long as your activity is in the background/foreground you should continue to receive location updates. But if the activity is destroyed then of course you won't get the updates.

    Check if you are disconnecting the location Client in your activity lifecycle.

提交回复
热议问题