I'm trying to figure out what is the best way to determine the relative position of another Android phone (it's position compared to mine). The phones will be in a WifiP2P range, so they can communicate with each other. I want it to be offline, if possible. I've thought a couple possible solutions:
Solution 1:
Use GPS in both devices, and compare it.
Problems:
- Can I use GPS offline?
- If two devices are in nearby area, is the GPS error going to be the same (or similar)?
- Will this give problems indoors?
Solution 2:
Calculate my relative position depending in the WifiP2P signal strength.
Problems:
- How can I calculate this relative position? (thought about something like triangulation but moving the phone to get the 3 or more different signals)
- Is there a
getRssi()
function for the WifiP2P (I haven't found one)? - I might need to check for the other device movement too.
- I've read that calculating your position changes with the accelerometer is not very accurate.
Any thoughts about this or any other possible solutions?
If there is not a "good" solution off-line, what would you suggest online? Would the Network Location Provider have the same (or similar) error on nearby devices?