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;
@Override
public IBinder onBind(Intent intent) {
return null;
}

@Override
public void onCreate() {
	beaconManager = new BeaconManager(this);
	beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
		@Override
		public void onServiceReady() {
			try {
				beaconManager.startMonitoring(ALL_BEACONS_REGION_TEST);
			} catch (RemoteException e) {
				
			}
		}
	});
	
	beaconManager.setMonitoringListener(new MonitoringListener() {
		
		@Override
		public void onExitedRegion(Region arg0) {
			generateNotification(getApplicationContext()," bye bye see you");
		}
		
		@Override
		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
		e.printStackTrace();
	}

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

@Override
public void onDestroy() {
	super.onDestroy();
}

private static void generateNotification(Context context, String message) {
	Intent launchIntent = new Intent(context, NotifyInContentActivity.class)
			.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
					| Intent.FLAG_ACTIVITY_SINGLE_TOP);
	((NotificationManager) context
			.getSystemService(Context.NOTIFICATION_SERVICE)).notify(
			0,
			new NotificationCompat.Builder(context)
					.setWhen(System.currentTimeMillis())
					.setSmallIcon(R.drawable.ic_launcher)
					.setTicker(message)
					.setContentTitle(context.getString(R.string.app_name))
					.setContentText(message)
					.setContentIntent(
		PendingIntent.getActivity(context, 0,launchIntent, 0)).setAutoCancel(true)
					.build());

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

Hell,
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:

beaconManager.setMonitoringExpirationMill(10L);

	beaconManager.setRangingExpirationMill(10L);

	beaconManager.setForegroundScanPeriod(5000,3000);

	beaconManager.setBackgroundScanPeriod(5000,3000);

Please reply me as soon as possible.

Thanking you.