如何在Application类中检测多个UUID的iBeacon源?

时间:2014-03-13 04:16:48

标签: ibeacon-android

使用专业版库,

Region region = new Region("com.radiusnetworks.androidproximityreference.backgroundRegion",
                "2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6", null, null);
        regionBootstrap = new RegionBootstrap(this, region);  

它只能接受一个UUID 但是,如果我想检测更多的UUID,我该怎么办?

1 个答案:

答案 0 :(得分:1)

有一个替代构造函数,允许您传递Region对象列表。试试这段代码:

Region region1 = new Region("com.radiusnetworks.androidproximityreference.backgroundRegion1",
            "2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6", null, null);
Region region2 = new Region("com.radiusnetworks.androidproximityreference.backgroundRegion2",
            "E2C56DB5-DFFB-48D2-B060-D0F5A71096E0", null, null);
ArrayList regionList = new ArrayList<Region>();
regionList.add(region1);
regionList.add(region2);
regionBootstrap = new RegionBootstrap(this, regionList);  

请参阅javadocs here