How to access motion data from beacon directly from the list

Hi all. I need to retrieve the motion data of beacons using the Android SDK without having to click on the single beacon. Is there a way to get this data in onBeaconDiscovered?
I’ve seen that on Android SDK Demos it’s used the class BeaconConnection but, for my purpose, it was impractical.

Hi @sbelfio24,
You have couple of options:
1/ Use BeaconConnection in order to get motion status.
2/ Enable Motion UUID. Enabling is available on iOS only but you can later use in on Android.
3/ Use Estimote’s stickers.

Thank you for the reply.

If I want to use BeaconConnection, is it possible to retrieve the motion data of several beacons at the same time?

Yes, you can connect to multiple beacons at the same time.

How can I do it? Can you be more exaustive?

Thanks

It should be as easy as creating one BeaconConnection instance per each beacon.

1 Like

Is it possible to create a BeaconConnection with a Beacon without using beaconManager’s scan?

The constructor of BeaconCollection want a Beacon instance but I don’t know how to create the instance of my Beacon without scanning.

Can you help me?

There’s a variant of the constructor which takes the MAC address instead of a Beacon object:

BeaconConnection(android.content.Context context, MacAddress macAddress, BeaconConnection.ConnectionCallback connectionCallback)

1 Like

thanks a lot for all your help!

Is it possible to get a Beacon instance from a BeaconConnection instance?

Because I want to join the motion info of the BeaconConnection class to the rssi info (rssi, proximity, distance) of the Beacon class…

[UPDATE] I’ve done it! I put together the BeaconConnection and the BeaconManager class.

1 Like

I managed to put together the BeaconConnection and the BeaconManager class but, when BeaconConnection connect to a Beacon, the BeaconManager scan doesn’t find this Beacon.

Any ideas on why it happens?

That’s because when you connect to a Bluetooth peripheral, it stops advertising ):

So, is there a way to get simultaneously both motion and rssi data?

In the class BeaconConnection there isn’t a method to get rssi and in the class BeaconManager there isn’t a method to get motion data…

I think this comes from nature of how beacon works. If you connect to them, they stop advertising signal and you can get detailed information. If you’re disconnected, they advertise signal and you can get RSSI for calculating distance. I think you can still get motion data by figuring out if it’s advertising motion UUID or normal UUID. But if I’m right, this way you only now if beacon is moving.

1 Like

@mlusiak is right, there’s no way to obtain beacon’s RSSI after connection, at the moment at least. Technically, there are APIs in Android for that, so we could implement this in the future.

For the time being, using Motion UUID, as @mlusiak mentioned, is a better way. There’s no way to enable it on Android yet, so you will need to borrow an iOS device for a second, and use the Estimote iOS app to enable Motion UUID. The app will also show you what’s the Motion UUID of your beacon. Then, you can use our Android SDK to scan for your beacons, and check if they’re advertising the regular UUID, or the Motion UUID.

1 Like

Thank you @heypiotr and @mlusiak!

You have been realy helpfull!