What is the best way to receive location updates in background?

前端 未结 2 1219
粉色の甜心
粉色の甜心 2021-01-25 23:42

I am trying to write an app that tracks location in background and sends data to a server -- to monitor where my family members are, for example.
Currently I am playing wi

2条回答
  •  余生分开走
    2021-01-25 23:58

    It comes out for Android 5 Lollipop it's better (much more stable) to use third-party library for bacground location receiving, namely io.nlopez.smartlocation.SmartLocation from 'io.nlopez.smartlocation:library:3.3.3', as decribed here, along with a foreground service, as Rudrik Patel mentioned. Works like a charm.

提交回复
热议问题