コード例 #1
0
 @Override
 public void onBeaconServiceConnected() {
   super.onBeaconServiceConnected();
   BeaconTrackServiceHelper.setBackgroundScanPeriod(this, 300);
   BeaconTrackServiceHelper.setForegroundScanPeriod(this, 300);
   BeaconTrackServiceHelper.addRegion(
       this, new Region("global", BeaconDataStore.ESTIMOTE_UUID, null, null));
   BeaconTrackServiceHelper.rescheduleMonitoring(this);
 }
コード例 #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_setup_beacon);

    tvHint = (TextView) findViewById(R.id.tvHint);
    tvStatus = (TextView) findViewById(R.id.tvStatus);
    ibBeacon = (ImageButton) findViewById(R.id.ibBeacon);

    if (!BeaconUtils.checkBluetoothAvaliability()) {
      BeaconUtils.turnOnBluetoothIfNotAvaliable(this);
    }
    BeaconTrackServiceHelper.restartBeaconTrackSerivce(getApplication());
  }
コード例 #3
0
 @Override
 public void onBeaconMonitoringEnter(ParcelableRegion region) {
   super.onBeaconMonitoringEnter(region);
   BeaconTrackServiceHelper.rescheduleRanging(this);
 }
コード例 #4
0
 @Override
 protected void onDestroy() {
   BeaconTrackServiceHelper.stopBeaconTrackSerivce(getApplication());
   super.onDestroy();
 }