4

I have recently acquired a beacon from Kontakt.io

I followed the "Monitoring code example" from here: http://docs.kontakt.io/android-sdk/quickstart/#monitoring-code-sample

The Kontakt library is included (since other methods from the library is working), but the following line is giving me an error:

beaconManager.startMonitoring(Region.EVERYWHERE);

Error:

startMonitoring (java.util.Set<com.kontakt.sdk.android.device.Region>) in BeaconManager
cannot be applied to (com.kontakt.sdk.android.device.Region)

I have also tried creating a new region with the proximity uuid from the beacon:

static UUID uid = UUID.fromString("1DEFF9522D014664BB6088F065302B83");
private static final Region beacon = new Region(uid, 49668, 35726, null);

but this throws the same error.

I'm quite new to java and this might be a fairly simple question, but how do i resolve this?

Nicolai Lissau
  • 7,298
  • 5
  • 43
  • 57
  • It looks like it expects a set of regions, not a single region. Try creating a set and adding your single region to it. – Gabe Sechan Dec 19 '14 at 00:02
  • Tried creating a HasdSet and adding the Region.EVERYWHERE constant to it: Set regSet = new HashSet(); regSet.add(Region.EVERYWHERE); Android Studio now accepts it as the right type, however I get a fatal error saying that the Venue set is empty or null – Nicolai Lissau Dec 19 '14 at 00:24

1 Answers1

5

If you check the changelog on their website you will see that there is new version of API. Clearly example is not updated. If you want to monitor Region.EVERYWHERE you can simply call beaconManager.startMonitoring() according to docs it should work.

skywalker
  • 318
  • 4
  • 10