Search code examples
androidestimote

How to return Estimote nearable type in android


I'm currently working on a project that should return a timestamp,nearable type, nearable id, temperature, proximity, moving/not.

Most of these returns can be found in estimoke.sdk.Nearable, while nearable type is found in cloud.model.nearabletype, though the problem is I don't know how to call it in my code.

I've tried

.append("Type: ").append(NearableInfo(NearableType)).append("\n")

and

.append("Type: ").append(currentNearable.NearableType).append("\n")

but both return errors, any help would be appreciated.


Solution

  • Nearable type is not broadcast in the advertising packet, that's why it's not part of the Nearable class.

    Instead, type is stored in Estimote Cloud, so you need to use the Estimote SDK to fetch it from there. You can do that via the EstimoteCloud#fetchNearableDetails method. You'll get the NearableInfo object in your callback, and that objects has the type property which has what you're looking for.