当前位置: 首页>>代码示例>>Java>>正文


Java Beacon.getId2方法代码示例

本文整理汇总了Java中org.altbeacon.beacon.Beacon.getId2方法的典型用法代码示例。如果您正苦于以下问题:Java Beacon.getId2方法的具体用法?Java Beacon.getId2怎么用?Java Beacon.getId2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.altbeacon.beacon.Beacon的用法示例。


在下文中一共展示了Beacon.getId2方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: logGenericBeacon

import org.altbeacon.beacon.Beacon; //导入方法依赖的package包/类
/**
 * log iBeacon and AltBeacon data.
 *
 * @param beacon
 */
private void logGenericBeacon(Beacon beacon) {
    uuid_numTV.append(beacon.getId1() + "");

    if (beacon.getId2() != null) {
        maj_numTV.append(beacon.getId2() + "");
    }
    if (beacon.getId3() != null) {
        min_numTV.append(beacon.getId3() + "");
    }
}
 
开发者ID:berger89,项目名称:beacon-finder,代码行数:16,代码来源:BeaconListAdapter.java

示例2: bindBeacon

import org.altbeacon.beacon.Beacon; //导入方法依赖的package包/类
/**
 * Binds beacon to view holder to display its data.
 *
 * @param beacon Beacon
 */
public void bindBeacon(Beacon beacon) {
    String majorMinorText = "Not available";
    if (beacon.getId2() != null && beacon.getId3() != null) {
        majorMinorText = mContext.getString(R.string.list_item_major_minor,
                mBeacon.getId2(),
                mBeacon.getId3());
    }
    mBeacon = beacon;
    mBeaconTitle.setText(mBeacon.getId1().toString());
    mBeaconDistance.setText(mContext.getString(R.string.list_item_distance, String.format("%.2f", mBeacon.getDistance())));
    mBeaconMajorMinor.setText(majorMinorText);
}
 
开发者ID:BoydHogerheijde,项目名称:Beacon-Scanner-Android,代码行数:18,代码来源:BeaconAdapter.java

示例3: didRangeBeaconsInRegion

import org.altbeacon.beacon.Beacon; //导入方法依赖的package包/类
public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) {

    Log.d("uk.ac.lancaster.library.backgroundbeacons", "didRangeBeaconsInRegion called");

    String regionIdentifier = null;
    String regionUUID = null;
    String regionMajor = null;
    String regionMinor = null;

    if (region.getUniqueId() != null) {
      regionIdentifier = region.getUniqueId().toString();
    }

    if (region.getId1() != null) {
      regionUUID = region.getId1().toString();
    }

    if (region.getId2() != null) {
      regionMajor = region.getId2().toString();
    }

    if (region.getId3() != null) {
      regionMinor = region.getId3().toString();
    }

    BeaconRegion beaconRegion = new BeaconRegion(regionIdentifier, regionUUID, regionMajor, regionMinor);

    for (Beacon beacon: beacons) {
      Log.d("uk.ac.lancaster.library.backgroundbeacons", "I see beacon " + beacon);

      String beaconUUID = null;
      String beaconMajor = null;
      String beaconMinor = null;

      if (beacon.getId1() != null) {
        beaconUUID = beacon.getId1().toString();
      }

      if (beacon.getId2() != null) {
        beaconMajor = beacon.getId2().toString();
      }

      if (beacon.getId3() != null) {
        beaconMinor = beacon.getId3().toString();
      }

      BeaconInfo beaconInfo = new BeaconInfo(beaconUUID, beaconMajor, beaconMinor);
      BeaconEvent beaconEvent = new BeaconEvent(beaconInfo, beaconDistanceToProximity(beacon.getDistance()), Double.toString(beacon.getDistance()), Integer.toString(beacon.getRssi()));

      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
      dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
      String timestamp = dateFormat.format(new Date());

      BeaconTrackingEvent beaconTrackingEvent = new BeaconTrackingEvent(this.settings.getDeviceId(), beaconEvent, beaconRegion, timestamp);

      this.beaconTrackingService.RangeBeaconEvent(beaconTrackingEvent);

      Log.d("uk.ac.lancaster.library.backgroundbeacons", beaconTrackingEvent.toJsonObject().toString());

    }

  }
 
开发者ID:lulibrary,项目名称:Background-Beacon-Monitoring,代码行数:63,代码来源:BeaconLoggingRangeNotifier.java

示例4: add

import org.altbeacon.beacon.Beacon; //导入方法依赖的package包/类
public void add(Beacon beacon) {
    PILogger.d(TAG, "adding beacon region for beacon: " + beacon.toString());
    String uniqueId = beacon.getId2().toString() + beacon.getId3().toString();
    Region beaconRegion = new Region(uniqueId, beacon.getId1(), beacon.getId2(), beacon.getId3());
    handleAddBeaconRegion(beaconRegion);
}
 
开发者ID:presence-insights,项目名称:pi-clientsdk-android,代码行数:7,代码来源:RegionManager.java


注:本文中的org.altbeacon.beacon.Beacon.getId2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。