本文整理汇总了Java中com.estimote.sdk.Beacon.getMajor方法的典型用法代码示例。如果您正苦于以下问题:Java Beacon.getMajor方法的具体用法?Java Beacon.getMajor怎么用?Java Beacon.getMajor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.estimote.sdk.Beacon
的用法示例。
在下文中一共展示了Beacon.getMajor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEnteredRegion
import com.estimote.sdk.Beacon; //导入方法依赖的package包/类
@Override
public void onEnteredRegion(Region region, List<Beacon> beacons)
{
LogUtil.d("onEnteredRegion. Region entered: " + region.toString());
for (Beacon beacon : beacons)
{
LogUtil.d(beacon.toString());
if (beacon.getMajor() == MAJOR)
{
WifiManager manager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
manager.setWifiEnabled(true);
setScanningMode(ScanningModes.HOME_MODE);
}
}
}
示例2: getLocation
import com.estimote.sdk.Beacon; //导入方法依赖的package包/类
public void getLocation(Beacon beacon, APIHandler<Location> handler){
// Iterate through locations
for(Location loc: mLocations.values()){
Beacon locBeac = loc.beacon;
if(locBeac.getMacAddress().equals(beacon.getMacAddress()) &&
locBeac.getProximityUUID().equals(beacon.getProximityUUID()) &&
locBeac.getMajor() == beacon.getMajor() &&
locBeac.getMinor() == beacon.getMinor()){
handler.onSuccess(loc);
return;
}
}
handler.onFailure(null, -1, "Can't find Location");
}
示例3: getIdentifier
import com.estimote.sdk.Beacon; //导入方法依赖的package包/类
private String getIdentifier(Beacon beacon)
{
String key = beacon.getMacAddress().toStandardString();
if (idMode == EstimoteBeacon.IdentificationMode.UUID_MAJOR_MINOR)
{
key = beacon.getProximityUUID() + ":" + beacon.getMajor() + ":" + beacon.getMinor();
}
return key;
}
示例4: fromBeacon
import com.estimote.sdk.Beacon; //导入方法依赖的package包/类
public static BeaconID fromBeacon(Beacon beacon) {
return new BeaconID(beacon.getProximityUUID(), beacon.getMajor(), beacon.getMinor());
}