Page 581 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 581
b.Beaconservicestart.sendData("2");
super.onDestroy();
}
private void popupNotification(String msg) {
Log.i("BackRangingService", "popupNotification()");
String currentTime = new SimpleDateFormat("HH:mm:ss",
Locale.KOREA).format(new Date());
NotificationManager nm = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this).setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(msg + " " + currentTime)
.setContentText(msg);
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
builder.setStyle(inboxStyle);
nm.notify(mNotificationID, builder.build());
mNotificationID = (mNotificationID - 1) % 1000 + 9000;
}
@Override
public void didRangeBeaconsInRegion(Collection<RECOBeacon> beacons,
RECOBeaconRegion mRegion) {
Main1 b = new Main1();
this.popupNotification("Enter beacon Region"+ mRegion.getUniqueIdentifier());
this.popupNotification("지역에들어옴");
this.popupNotification("motor stop");
if(flag==1&&beacons.size()==1&&mRegion.getMinor()==20599)
- 574 -