0

I'm working in an Android iBeacon app to manage promos in shops. When the customer are near the shop, the app will send a notification with the best promotion or discount.

I'm using the latest version of Altbeacon library to detect when a user enters a region. The problem is that I'm following the reference example with the monitoring management into the main Application class ("Starting an App in the Background"). It works fine, but in this approach the app is always monitoring an scanning for beacons. I need to allow the user to start and stop the service of monitoring, and I don`t know how to do it with the logic in the Application class. Do I need to use an IntentService to manage this?

Can anyone show me in a simple example how I can start or stop the monitoring from a button or a switch? I need not only to bind and unbind the beaconManager, but to start or stop really the scanning to save battery if the user doesn't want to use the promotion system.

Thanks in advance!

1 Answers1

0

The Auto Battery Saving Example Code?

Maybe you are looking for regionBootstrap.disable(); you can see it on the didEnterRegion in the Starting an App in the Background