I would like to have push notifications when my app is open but is in background. For now I have changed the Estimote Demo, and my app gives me a notification when my app is
You should create service.
In your code you should do some changes.
After
beaconManager = new BeaconManager(this);
you should start "beacon service"
if (!beaconManager.isBluetoothEnabled()) {
stopSelf();
}
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
@Override
public void onServiceReady() {
try {
beaconManager.startRanging(ALL_ESTIMOTE_BEACONS_REGION);
} catch (RemoteException e) {
Log.e("error", "Cannot start ranging", e);
}
}
});
Also check if Bluetooth is active on you device.
In procedure beaconManager.setMonitoringListener(new MonitoringListener() add commands to create Notifications.