15
I am developing an React Native application that requires devices to be laid side by side and/or above and below each other.
I know I can use the Nearby API to detect devices "Nearby" however I need something a little more "Finer Grained".
My app needs to be able to identify a device laying either on the left side, above, right side or below. While all devices are laying flat on a table (for instance).
I can find nothing on the web that describes this use case.
Is it possible?
UPDATE
My use case is that I want Android devices to be able to detect any number of "Other Devices" laying either to their left or right. The devices will be laid out horizontally with a "small" gap between each one.
In the same way that you might layout children's lettered blocks to spell out a word or phrase, or numbered blocks to make a sum.
not only should the line of devices be able to detect their immediate neighbours to their left and right the two devices at either end should be able to detect they they are the start and end (reading left to right) of the line.
That's not really possible. You can talk to nearby devices using NFC, bluetooth, etc. But those are broadcasts, there's no enough data to tell where a signal comes from from a single broadcast point. It could be left, right, above, below, behind, in front of. At best you can get a guess on distance via signal strength.
You could try to use location to tell that. But location, even gps, is accurate to 10m or so if you have good signal strength. It isn't accurate enough for this. Even if you did something like bluetooth beacons at fixed locations (which woukld require you to do this in only known locations with special hardware installed) it's not likely to be accurate enough for sub-meter precision like you want.
IF you own the hardware, the best thing to do would be to assign each phone an id and let it display based on its id. If you're expecting to do this with random hardware, I don't think there's any way to make this work.