I have a MapView in which I am drawing buildings on using geopoints. Currently, the app determines the closest building to you by just checking your long/lat and comparing to the buildings; but what I want to be able to do is point my device at a building and have that buildings info pop up, even if it isn't the closest building to you.
I have looked up how to accomplish this and I would be using the azimuth direction received from the ORIENTATION sensor listener. I am having trouble using that azimuth direction and determining if it is intercepting one of the buildings on the map.
I have also attempted to calculate the bearing using this formula:
between your current location and a building close to you to see if I could solve this problem that way, but I got nowhere.
Would I be using the ORIENTATION or MAGNETIC_FIELD sensor to accomplish this? How would I go about implementing this? Any help appreciated!