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 1358
梦毁少年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

    I've done what you are looking for, both with GPS and non-GPS.

    The project I took as staring point for the non-GPS solution already does all you need, and is battery-friendly (credits should go to Kenton Price):

    https://code.google.com/p/little-fluffy-location-library/

    Take a look at it, it works like a charm. Just run it in any device. If you need any help customizing just let me know.

    Just edit the "onReceive" method in the "TestBroadcastReceiver" to update your DB.

    If you need the GPS solution let me know too, but I dropped it for being a battery killer!

    Hope it helps.

提交回复
热议问题