How to set notification on every beacon detection

Please reply me how to set notification on each beacon detection.Please send if any sample android project describes my problem.Hoping reply as fast as possible.

Thanking you …

If you use beaconManager.startMonitoring(ALL_BEACONS_REGION);
you can startMonitoring with each beacon
just like
beaconManager.startMonitoring(new Region(“apr”,uuid1,major1,minor1));
beaconManager.startMonitoring(new Region(“apr”,uuid2,major2,minor2));
beaconManager.startMonitoring(new Region(“apr”,uuid3,major3,minor3));
it will notification with this three beacon
In AprilBeaconDemos NotifyService you can add this to try

public class NotifyService extends Service{

private BeaconManager beaconManager;

// private static final Region ALL_BEACONS_REGION = new Region(“apr”, null,null, 65535);

private static final Region ALL_BEACONS_REGION_TEST = new Region("apr", "b9407f30-f5f8-466e-aff9-25556b57fe6d",54910,27038);

// uuid1=b9407f30-f5f8-466e-aff9-25556b57fe6d;
// major1=54910;
// minor1=27038;
public static final int READ_BATTERY = 0;
public IBinder onBind(Intent intent) {
return null;

public void onCreate() {
	beaconManager = new BeaconManager(this);
	beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
		public void onServiceReady() {
			try {
			} catch (RemoteException e) {
	beaconManager.setMonitoringListener(new MonitoringListener() {
		public void onExitedRegion(Region arg0) {
			generateNotification(getApplicationContext()," bye bye see you");
		public void onEnteredRegion(Region arg0, List<Beacon> beacons) {
			generateNotification(getApplicationContext(),"I am come in ! haha !");
	 String uuid1="b9407f30-f5f8-466e-aff9-25556b57fe6d";
	 int major1=54910;
	 int minor1=27038;
	try {
		beaconManager.startMonitoring(new Region("apr",uuid1,major1,minor1));
	} catch (RemoteException e) {
		// TODO Auto-generated catch block

// beaconManager.startMonitoring(new Region(“apr”,uuid2,major2,minor2));
// beaconManager.startMonitoring(new Region(“apr”,uuid3,major3,minor3));

public void onDestroy() {

private static void generateNotification(Context context, String message) {
	Intent launchIntent = new Intent(context, NotifyInContentActivity.class)
	((NotificationManager) context
			new NotificationCompat.Builder(context)
		PendingIntent.getActivity(context, 0,launchIntent, 0)).setAutoCancel(true)

I tried in this way but notification is not generating.can you please fix this and make to generate notification

Did you start or bind this Service
The button at the bottom of ModifyActivity is to start service

please help me i want to display notification at the listview activity only(first activity) for every beacon.But my condition is it should not be repetive for a time.

you can add a flag or a collection to store the beacon which have been notified

hi hell,

The service is calling for 52 times only after that it stops ranging and listening how to do it has to continuously call ranging and listening.

Thanking you…

If you have not stop the service, It can’t stop.
Unless some other app stop the service or the system stop the service.
You can listen the service’s lifecycle
If the service was stop you can start again

Can please tell how to set the monitoring listener period and ranging period.Know it ranging for every 2 seconds and please tell me how to increase this time and please clear my doubt when will monitoring listener will call.

Please explain me what are these 4 parameters functionality:





Please reply me as soon as possible.

Thanking you.