Search code examples
androidandroid-alarmsandroid-geofence

Android daily updating geofences


I'm working on creating a coupon/deals app. The premise is that each day there will be special deals at different stores. When a user happens to be close to a store (within a geofence), I'd like to send a notification to the user of the coupon/deals at that store.

Given that the stores may change daily, I'm trying to figure out the best way to update the Geofences.

One idea - use AlarmManager to create an alarm that would trigger at like 12 am each day that sends an intent that starts a service that queries my server > pulls the list of new Geofences > sets those new Geofences.

Is that reasonable? Is there a better way to handle it?

Thanks!


Solution

  • You're on the right path, check CommonWare's Repository

    It doesn't keep the device on wake up and only to do the service call.