Is it possible to sending notification to the android app when user device enter the region of beacon and automatically send the notification without open the app even user screen is off.
Hi,
Monitoring in the background on Android - Apps can use startMonitoring method of BeaconManager class to start monitoring regions. Monitoring updates arrive at a mobile device registered with the setMonitoringListener method of BeaconsManager class.
Monitoring is designed to perform periodic scans in the background. By default it scans for 5 seconds and sleeps 25 seconds.
Please keep in mind that monitoring will not launch your app if it's "killed".
Best,
I have done this, but the problem is i'm getting notification after opening the app only..I'm not getting the notification when my app isn't open but i'm at inside region.
beaconManager.setBackgroundScanPeriod(TimeUnit.SECONDS.toMillis(1), 0);
beaconManager.setMonitoringListener(new BeaconManager.MonitoringListener() {
@Override
public void onEnteredRegion(Region region, List<Beacon> list) {
postNotification("Entered region");
}
Is it possible to get notification, if i'm at inside region but i don't open the app
Hey Raj—like Witek said, definitely possible, but you need to open the app first and then you should be able to turn the screen off or open another application while still getting the notification. See the Notify Demo from our Demos project on http://github.com/Estimote/Android-SDK for more details.
Note that your Android operating system might kill the app when it's not on screen and system resources are running low—if you implement the monitoring correctly and are still not getting the notification, then it is quite likely because of that. Try killing all the other applications first and/or run your app on a more powerful Android device.
You can make a service class to run on background make estimote setMonitoring listener in the service class only. By this you can track the enter and exit of the device .