Background Process to scan the location of the user at regular intervals and update the local database even when the app is not open

前端 未结 6 1359
梦毁少年i
梦毁少年i 2021-01-05 10:32

I am creating an app that checks for user locations every half an hour and updates the location of the user in the local database and then runs CRUD queries based on the use

6条回答
  •  梦谈多话
    2021-01-05 11:26

    When recording the users position use a service with a notification. Just for the sake of creating a morally responsible app that informs the user the app is tracking them. The service by definition runs in the background.

    A fused location provider with setinterval(long) 30 minutes gets the interval. Set fastestInterval() to a minute to receive GPS data when other apps are using the GPS.

提交回复
热议问题