Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] java – Is it possible to determine the location of a phone in relation to another phone (or just get accurate GPS data) based on bluetooth or wifi?

Posted on November 11, 2022 By

Solution 1 :

No, you can’t- you don’t get enough data. Let’s say you have 2 phones A and B. A can broadcast a message over bluetooth (this works the same for any other radio type, including wifi). The receiver B can determine it’s strength when it receives it. From that and knowing how strong it was when sent, it can know its approximate distance. So you don’t know what direction A is, but you know how far he is. And that’s all you can get. So you know B is in a circlearound A (this isn’t 100% accurate as due to signal noise you’re actually in a 2d- ring, but lets assume a perfect world here).

Now imagine A is at a fixed point. Now lets add in phone C, at another fixed point. If you got a message from A and from C and did the same signal strength math, you now B’s distance from A and C. Two circles, one around A and C. B will need to be at one of the crossing points- there will be 2 of them. You don’t know which.

Now add in D. You now have 3 circles. All 3 will cross at only 1 point. That’s B’s location. It takes 3 fixed points to find someone. In museums and other indoor places that do location tracking, you’ll see dozens of bluetooth beacons, each with their own id, and you triangulate based on which ones you can see at all and which are closest.

That’s finding your location relative to fixed points. With non-fixed points, to find someone you’d need to become the 3 points yourself. Imagine B stands still. A can make a reading. Then he can move 10 feet away. Take another reading. Move 10 feet away (not all in one line). Now you have 3 readings and can figure out where B is using the same math as above. Please note that to use this, you have to know very accurately exactly how far and in what directions you moved between the 3 points. If you don’t, you won’t get any accuracy. It doesn’t matter what direction you moved, but you need to know that and the distance exactly.

READ  [FIXED] java - Without data parameter with Firebase Functions for Android
Powered by Inline Related Posts

Now if B is moving, that math will be off. But given the short distances involved it would probably be close enough to find them.

(all this assumes elevation isn’t invloved, if it is you need more points).

Now if you’re willing to take a hardware based answer- if you have something on the phone that can block the bluetooth signal and you can adjust physically you could get directionality by blocking it to all but a 30 degree cone, trying to read the signal, and moving the blocker until you can. Then you know the direction to within 30 degrees and the distance. But my guess is you’re not willing to have them carry lead phone cases 🙂

Problem :

I want to determine the location or the direction of a phone in relation to another phone using wifi or Bluetooth since GPS is not accurate enough indoors. Is this possible? I have tried googling it, but I have not been able to find a sufficient answer.

Thank you for your help!

Comments

Comment posted by Kaan

It does not seem possible to use wifi or bluetooth to determine location. Wifi doesn’t provide anything about location or position of a device (assuming a single wifi router), at best you could get signal strength and try to extrapolate something from there. Bluetooth is similar, you could perhaps check signal strength or measure timing between devices. But interior walls, or human hands holding a device, or appliances, or any number of things make either approach seem unlikely to be useful.

Android Tags:android, ios, java, mobile, swift

Post navigation

Previous Post: [FIXED] Unable to connect Firebase in Android Emulator for Flutter Project
Next Post: [FIXED] android – Highlight only one Card in Compose through selection

Related Posts

[FIXED] admob – ConcurrentModificationException in Android.onCreate (com.google.android.measurement.internal) Android
[FIXED] android – How to use PowerMock with Mockito3.x? Android
[FIXED] android – Disable editing/text input and paste from clipboard of EditText Android
[FIXED] java – Need for message text and time retrieved from Firebase to be of different sizes, but end up in same TextView Android
[FIXED] android – How to count children of the tree in Kotlin Firebase? Android
[FIXED] android – Is there a way to get the BarCode format name when using Firebase MLkit Library? Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • What is a good substitute for condensed milk?
  • ¿Como el cuerpo te avisa cuando te va a dar un infarto?
  • What is the luxury brand of Jaguar?
  • Who is Big poppa baseball player?
  • What material are foam runners?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme