Android location updates in a Service

后端 未结 4 729
礼貌的吻别
礼貌的吻别 2020-12-09 05:58

I want to do something like this:

  • When my application starts I want to start a Service which should check my location

  • When the application g

4条回答
  •  旧巷少年郎
    2020-12-09 06:42

    I suggest you to use the latest location api provided by google(also compatible to version 2.2).

    here is a example shows how to use that: https://github.com/chenjishi/android_location_demo

    when your app run to background, you can call disconnect to stop the location update.

提交回复
热议问题