I would like to detect the position of the Android mobile device without internet connection. The only option being, to use the info from nearby Cell Towers, I want to know whether TelephonyManager class can be used for this(Assuming that the lat&long positions of Cells are available in a database)?

I know that TelephonyManager.getNeighbouringCellInfo() provides a List of NeighbouringCellInfo.

My Question is, How many NeighbouringCellInfo does this method return? and Can this info be used to perform triangulation?

If not can I make use of SIM Toolkit to get the required info and perform triangulation?

Please feel free to provide any relevant inputs as it would be much useful for my proceedings.

有帮助吗?

解决方案

First of all, you certainly can't do triangulation. Triangulation relies on angles. I think what you mean is trilateration. Trilateration -- by contrast -- relies on distances.

To trilaterate based on distances, you need a database with concrete coordinates, and a distance to three or more of those coordinates (in this case, cell towers). However, if you look at the documentation for NeighboringCellInfo, you will see that you do not get a distance reading. You get an RSSI. The connection between RSSI and distance is not linear, and is not well understood or very accurate. It can vary greatly depending on antenna orientation, weather conditions, etc... So thinking that you will simply be able to pick three cells and use their relative RSSIs to trilaterate a user will ultimately prove to be very error prone (i.e., pretty much downright wrong most of the time). Along with all of this, I don't believe that getNeighboringCellInfo can always be guaranteed to return three or more towers (you can view the implementation of the low level code here). As such, my verdict is that the best you can do is find out which tower has the highest strength and say you're somewhat "close" to it, I really doubt you can do any better than that.

Instead, a much better option, which I'm sure you've thought of, is to use GPS, but I'm guessing you have a reason not to want to do that.

I'm not sure if you also know, but TelephonyManager has an implementation that will give you location updates as well: here.

(By the way, I did a similar trilateration project once, and in my experience, without highly accurate receivers and measurements, it just doesn't work. I also had raw RSSI data, and even at short to medium ranges the errors in data were wildly unacceptable.)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top