Best Practice to report user location continuously

后端 未结 1 334
醉话见心
醉话见心 2020-12-24 08:59

I\'m designing an application where application in server side need to be continuously aware of user location. I\'m thinking to create an Android service that run in the bac

相关标签:
1条回答
  • 2020-12-24 09:52

    I suggest to create a background Service which just uses the NETWORK_PROVIDER and the PASSIVE_PROVIDER. You can use the minTime and the minDistance parameter to avoid draining the battery. Documentation

    And Reto wrote a great post about obtaining users location http://android-developers.blogspot.com/2011/06/deep-dive-into-location.html

    Regarding your comment you have to start your service sticky: Documentation

    0 讨论(0)
提交回复
热议问题