I am interested in using mobile phones for conducting network field tests - i.e. collecting information about signal strength as well as other related values for a mobile network, in particular for 4G-LTE-networks.
There are a couple of applications already out there which can do this, e.g. GNet-Track (https://play.google.com/store/apps/details?id=com.gyokovsolutions.gnettracklite)
These apps are using the TelephonyManager's getAllCellInfo() to retrieve information for the serving cell (the cell to which the mobile is connected to) as well as for neighboring cells (cells that the mobile can detect but is not connected to).
Depending on the mobile phone (e.g. http://www.gyokovsolutions.com/survey/surveyresults.php) as well as on the connection technology (3G, 4G, etc.), more or less information is retrieved with getAllCellInfo(). E.g. some phones do not report information about neighboring cells at all, while other might only report the strength of the signal, etc.
From a CellInfo object, one can retrieve the identity of the cell via getCellIdentity() (to be precise, it's getCellIdentityLte(), getCellIdentityGsm() etc. in dependence of the used network technology).
The CellIdentityLte object contains (or at least should contain) the values mcc, mnc and ci (cell-identity), which can be used to identify a cell globally (computing the ecgi).
Now, the problem I am facing is that every phone that I have encountered so far (e.g. OnePlus-Three, Samsung S7) is unable to report the cell-identity of the neighboring cells (instead UNAVAILABLE (=2147483647) is returned). Other values are available, e.g. the field PCI of the LTECellIdendity of the neighboring cells were available.
My question is: Has anyone encountered mobile phones which are able to report the cell-identity of neighboring cells in a 4G-network?
This seems to be a recurring problem (the linked discussions concern other technologies, but face the same problem):
https://github.com/mozilla/ichnaea/issues/17
cellID and LAC / PSC for 3G neighboring cells in Android
Related
The official android documentation said that the getAllCellInfo() method, which is responsible of returning all observed cell information from all radios on the device including the primary and neighboring cells, returns valid data for registered cells on devices with FEATURE_TELEPHONY.
My problem is that only the first cellInfo (I suppose the one my phone is connected to) returns true when calling CellInfo.isRegistered(). what is a registered CellInfo?
Registered Cell is the Network Cell that your device is actually registered to.
Neighboring cells just shows a list of neighboring cells which are being monitored by the device. However, device is not registered to them.
It must track those cells and measure its signal levels since it may need to move to a better cell - with better signal quality, for example).
So, I believe it is normal return isRegistered() == true only for primary cell.
I am a beginner in android developing and I am working on a project to create an app to locate cell phones without using GPS.Can anybody help me with how to get the RSSI for GSM and the distance if possible.Any code available for this purpose would be appreciated really.
I would also like to know, what other information can we get from the SIM card.
For SIM information including RSSI, you need to look at the Android Telephony and related APIs.
You can't get the distance from the base station though. You can get the Cell Id, which gives you a rough location if matched up to a database. Cell Id information is proprietary though, and publically available databases aren't always that accurate. Or you could use three Cell Ids + RSSIs to do a rough triangulation calculation yourself. The disadvantages with that are that many devices won't return cell info for the surrounding cells; you still need access to a reliable database of cell locations; ideally you should also include known WiFi hotspots; it's a lot of work to implement something that Android has already done.
Android handles location via its own location and location services APIs. LocationManager lets you choose the desired technology, e.g.NETWORK_PROVIDER or GPS_PROVIDER. So you could just choose not to use GPS, and let Android give you the best available result from the network.
I tried getting neighboring cell signal strengths like this: Getting CID, LAC and signal strength of all cell towers in range -- however this doesn't seem to be supported with most Samsung phones (just returns blank list). I get a similar result when I run the "GSM Signal Monitoring" app -- no nearby cell info available.
This being said, I CAN access this information if I manually dial *#0011#; ServiceMode pops up, and if I choose "back" and "Neighbour Cell" I can get a number of neighboring cell masts and their signal strengths.
My question is as follows: Is there a way to programatically get this data from ServiceMode, or another way to get this data other than the way mentioned in the url that will work on Samsung phones? The data is clearly there; the question is how to get it.
I "play" with google/glm/mmap in order to find the coordinates of a cell. I note that the returned values can changed (queries on several days).
Any explanation ?
It appears that the coordinates returned are a weighted average of locations where cell phones reported connecting to that base station. That is, they are not the coordinate of the base station antenna. This is actually better for geolocation purposes since you want to know where the cell phone is, not where the base station is. One of the parameters returned with the coordinates is a measure of the "spread" of the reports --- which gives one some idea of how accurate the geo-location is likely to be. It appears that as reports continue to come in to mmap, the data base is updated and so changes are possible over time, usually rather minor.
Note that, in the case of CDMA at least, the true location of the base station antenna can be obtained using getBaseStationLatitude() and getBaseStationLongitude() methods on cellLocation in e.g. onCellLocationChanged() callback. This is not supported by all carriers. U.S. Cellular does provide this information, Verizon Wireless sadly does not. Femtocells do provide the information using their built in GPS. Again, depending on your application, knowing the base station location may not be what is required.
Is there any way in Android to detect all available carrier networks in the area. I tried to search it from connectivity manager and it seems it only returns active network info. I also tried the telephony manager and it only returns signals and neighbor info of the active carrier (e.g. other signals of same carrier). I would like to create an app that will scan for available cell networks in every country -- like in Settings -- to choose my network when roaming.
as far as i know that is not possible, because you can only get the cell info of your SIM carrier, but we have a new method on TelephonyManager called getAllCellInfo ().
The problem is that method its only available on API Level 17, only available on devices with Jelly Bean (4.2).
Check this link for more information.
Even the getAllCellInfo function will never report "all networks" that are in the air at your location, simply because the phone will only listen to / measure on the frequencies / networks that the current serving cell tells it to measure on. Normally this means that it will only measure (and be able to report cells) from the same network as the phone is currently using.
If the phone has lost coverage from its "home PLMN" (home or selected network) it will however periodically do measurements in other frequencies to try to get back to it's "favourite network".
To be able to get lists of all present networks in your area you need to have another kind of device for example a "scanner", which never locks on to any cell, but continuously scans many frequencies to find cells from any network and any radio access technology (GSM/WCDMA LTE for example) within these frequencies.
Or continuously press the "select network" function...
/ Kenneth