本文整理汇总了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() + "");
}
}
示例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);
}
示例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());
}
}
示例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);
}