Jump to content

Problems programming Android signal-strength reporting for LTE


boomerbubba

Recommended Posts

Robert and several others have noted that the various third-party Android apps that purport to report signal strength for LTE connections get it wrong. I have been researching this, and it seems that the underlying Android API is pretty messy in the way this information is made available to calling apps.

 

In the first place, the standard Android telephony API does not yet define a consistent method for providing this data, like it does for GSM and CDMA phones. (It also does not provide for Wimax.) There is an outstanding feature request at Google to expand that standard, but no action yet. One comment under that outstanding issue documents a workaround, but it was not documented until about three weeks ago.

 

This does not excuse the third-party developers for reporting the wrong values, but it does help explain how they came to do so.

 

The lack of a standard Android programming interface also means that the OEMs (manufacturers building phones to carriers' specs) writing firmware on various devices have been on their own, probably pulling this data from lower-level drivers or hidden APIs. I certainly hope this is not the root cause of the apparent problems setting the thresholds levels at which Sprint handsets fall back to EVDO from LTE connections. Getting the actual LTE signal strength right is obviously critical to that.

 

(I also found that one app developer, frustrated with inconsistent practices by OEMs who even mess up some of the Android API calls that are standard, has built a diagnostic app to discover and catalog what different devices actually do at the API level.)

  • Like 4
Link to comment
Share on other sites

  • 5 months later...

The good news is that API level 17 (Android 4.2) does include the necessary information for LTE, CDMA, and GSM/UMTS. The bad news is that very few devices are at API level 17 yet (I guess the Galaxy Nexus and Nexus 4S on Sprint are the only two).

Link to comment
Share on other sites

I think folks are wanting something that shows the info available with the CellInfo and CellIdentity classes, like the physical cell ID. Poking around the code base at android.googlesource.com, it looks like the API is actually in the code base in 4.1 (API level 16) even though it's not documented until 4.2 (API level 17). So maybe it actually works on 4.1 devices too. I may play around a bit this week and see if I can get some code using the API to work on my Evo LTE and Nexus 4.

Link to comment
Share on other sites

I think folks are wanting something that shows the info available with the CellInfo and CellIdentity classes, like the physical cell ID. Poking around the code base at android.googlesource.com, it looks like the API is actually in the code base in 4.1 (API level 16) even though it's not documented until 4.2 (API level 17). So maybe it actually works on 4.1 devices too. I may play around a bit this week and see if I can get some code using the API to work on my Evo LTE and Nexus 4.

 

I'm trying to carve out some time and get rid of some of my To Do list to work this as well. My dream would be to have an app with all the 1X, EV, and LTE info on one screen. PNs for 1X and EV along with strength, and both LTE sector IDs and strength on the same screen. And your current LAT an LONG to go with that as well! Awesome!!

Link to comment
Share on other sites

I'm trying to carve out some time and get rid of some of my To Do list to work this as well. My dream would be to have an app with all the 1X, EV, and LTE info on one screen. PNs for 1X and EV along with strength, and both LTE sector IDs and strength on the same screen. And your current LAT an LONG to go with that as well! Awesome!!

 

Now that would be cool if you could pull this off!

Link to comment
Share on other sites

Have you tried this app yet? Sent from my SPH-L710 using Tapatalk 2

 

Advanced Signal Status is from the same developer and is basically the same as this earlier side loaded app, Android Signal Info:

 

1qmil3.png

 

The problem with Android Signal Info that may still carry over to Advanced Signal Status is that the developer is a VZW user, and he based at least his RSSI calculations on 10 MHz FDD LTE. Sprint is deploying 5 MHz FDD, as is AT&T in some markets. Thus, those RSSI figures are incorrect for anything other than 10 MHz FDD.

 

Moreover, in the thread below, the developer does not seem to understand SNR very well, as he comments on 300 dB SNR, which is actually 30 dB SNR because the figure/calculation is missing a decimal point. A 300 dB SNR is essentially impossible.

 

http://rootzwiki.com...s-signal-sucks/

http://rootzwiki.com/topic/36320-app2012-11-11-android-signal-info/

 

So, right now, I do not put much faith in the accuracy of the app. However, if somebody wants to contact the developer and get some clarification, I would welcome that info. His Twitter account is below:

 

https://twitter.com/yarlyyyy

 

AJ

Link to comment
Share on other sites

I'm trying to carve out some time and get rid of some of my To Do list to work this as well. My dream would be to have an app with all the 1X, EV, and LTE info on one screen. PNs for 1X and EV along with strength, and both LTE sector IDs and strength on the same screen. And your current LAT an LONG to go with that as well! Awesome!!

 

I am working on a app that will.

 

Signal strength of 1X, EVDO, and LTE.

And LTE 28-bit Cell Identity, Physical Cell Id 0..503, and 16-bit Tracking Area Code using CellIdentityLte.

But I don't have it working yet (if anyone can help me then PM me or on this topic).

 

 

https://docs.google.com/file/d/0BwjoW3wFn2LrTmdxV1JKeElhLVk/edit

  • Like 1
Link to comment
Share on other sites

 

Advanced Signal Status is from the same developer and is basically the same as this earlier side loaded app, Android Signal Info:

 

1qmil3.png

 

The problem with Android Signal Info that may still carry over to Advanced Signal Status is that the developer is a VZW user, and he based at least his RSSI calculations on 10 MHz FDD LTE. Sprint is deploying 5 MHz FDD, as is AT&T in some markets. Thus, those RSSI figures are incorrect for anything other than 10 MHz FDD.

 

Moreover, in the thread below, the developer does not seem to understand SNR very well, as he comments on 300 dB SNR, which is actually 30 dB SNR because the figure/calculation is missing a decimal point. A 300 dB SNR is essentially impossible.

 

http://rootzwiki.com...s-signal-sucks/

http://rootzwiki.com/topic/36320-app2012-11-11-android-signal-info/

 

So, right now, I do not put much faith in the accuracy of the app. However, if somebody wants to contact the developer and get some clarification, I would welcome that info. His Twitter account is below:

 

https://twitter.com/yarlyyyy

 

AJ

 

Nice post on Google Play Store. B) I gave it a thumbs up in hopes it'll stay at the top and people see it.

 

Sent from my Rooted Sony Tablet S using Tapatalk HD

Link to comment
Share on other sites

While we're sharing code, here's what I hacked together from the SignalStrengthDetector source on GitHub. It's not great but it should at least allow you to see if your phone (running 4.1 or later) fills in the CellInfo and CellIdentity classes or not.

 

https://github.com/lordsutch/Signal-Strength-Detector

 

Here's the APK (no guarantees, only tested on Nexus 4 and Evo LTE, may do strange things on other devices, don't email me your output, yadda yadda): https://www.dropbox.com/s/nhd729pckawlndm/HomeActivity.apk

Link to comment
Share on other sites

While we're sharing code, here's what I hacked together from the SignalStrengthDetector source on GitHub. It's not great but it should at least allow you to see if your phone (running 4.1 or later) fills in the CellInfo and CellIdentity classes or not.

 

https://github.com/l...rength-Detector

 

Here's the APK (no guarantees, only tested on Nexus 4 and Evo LTE, may do strange things on other devices, don't email me your output, yadda yadda): https://www.dropbox....omeActivity.apk

 

What is the app supposed to display? On a stock Jelly Bean GS3 I get only an empty screen, with the title "Signal Detector" and 2 small bars at the bottom labeled "Cancel" and "Submit". "Cancel" . . . cancels. "Submit" doesn't do anything. Have I loaded it incorrectly? Is my GS3 simply incompatible with the app? Have I missed something critical?

 

Thanks, both for posting the app, and for your answer when it comes.

Link to comment
Share on other sites

If it doesn't show anything at all, the getAllCellInfo() call is returning null on your phone. I'd be surprised if it showed anything on a phone with JB 4.1, since the API was hidden and not expected to work, but it also doesn't do anything on the Nexus 4 (even though it is the launch 4.2 phone).

Link to comment
Share on other sites

After a bit more poking around in the code Google has thrown over the wall, here's what I can say about the getAllCellInfo() API in Android 4.2 (specifically in the *ServiceStateTracker classes of the Telephony API):

 

- It just returns null on GSM phones, with or without LTE (not implemented at all, so base ServiceStateTracker does it).

- It just returns null on CDMA-only phones (subclass returns null).

- It works on an CDMA+LTE phone, but only returns LTE data.

 

So if you're a brave soul running a Sprint LTE phone with a 4.2 ROM (either official or a mod) it may work. But I wouldn't hold your breath on any other devices.

Link to comment
Share on other sites

After a bit more poking around in the code Google has thrown over the wall, here's what I can say about the getAllCellInfo() API in Android 4.2 (specifically in the *ServiceStateTracker classes of the Telephony API):

 

- It just returns null on GSM phones, with or without LTE (not implemented at all, so base ServiceStateTracker does it).

- It just returns null on CDMA-only phones (subclass returns null).

- It works on an CDMA+LTE phone, but only returns LTE data.

 

So if you're a brave soul running a Sprint LTE phone with a 4.2 ROM (either official or a mod) it may work. But I wouldn't hold your breath on any other devices.

 

The dev team at Sensorly is reporting success using the 4.1.1 Jellybean API to harvest this information, but only on certain devices that populate it -- which does include the stock Samsung GS3. Sensorly hopes to release this in its user interface before February.

Link to comment
Share on other sites

Hey guys,

 

I actually have been working on an app called SignalCheck that does this. Robert has been beta testing it for me over the past few months and gave me permission to promote it here on S4GRU.. I haven't had a chance to post about it here, it's funny that people have just started talking about it over the past few days! I started developing it last October, and released it to the public on Google Play a couple of weeks ago.

 

I started a thread about it here: http://s4gru.com/ind...hs-all-at-once/

 

I am aware of the new features in Android 4.2 and I'm currently working on adding them in.. specifically the identity of LTE cells.

 

I have been trying to educate myself as much as possible regarding cellular technologies so that this app is as technologically correct as possible. I see a mention of SNR above; it appears my app might be reporting values 10x too high as well. If someone could confirm this for me, the code changes would be easy for me to implement.

 

To keep things on-topic, if you have any questions about my app, reply in the other thread. I'd be more than happy to participate in the programming aspect of things in this thread.

 

Thanks,

-Mike

 

EDIT: I just uploaded a new version with the LTE SNR corrected, as well as LTE cell info for Android 4.2 users.. it will probably take an hour or so before it shows up on Google Play. I probably jumped the gun a bit on the LTE cell info since I do not have a 4.2 device to test it on, so hopefully one of you guys can let me know if it crashes or not!

Edited by mikejeep
  • Like 1
Link to comment
Share on other sites

Hey guys,

 

I actually have been working on an app called SignalCheck that does this. Robert has been beta testing it for me over the past few months and gave me permission to promote it here on S4GRU.. I haven't had a chance to post about it here, it's funny that people have just started talking about it over the past few days! I started developing it last October, and released it to the public on Google Play a couple of weeks ago.

 

I started a thread about it here: http://s4gru.com/ind...hs-all-at-once/

 

I am aware of the new features in Android 4.2 and I'm currently working on adding them in.. specifically the identity of LTE cells.

 

I have been trying to educate myself as much as possible regarding cellular technologies so that this app is as technologically correct as possible. I see a mention of SNR above; it appears my app might be reporting values 10x too high as well. If someone could confirm this for me, the code changes would be easy for me to implement.

 

To keep things on-topic, if you have any questions about my app, reply in the other thread. I'd be more than happy to participate in the programming aspect of things in this thread.

 

Thanks,

-Mike

 

EDIT: I just uploaded a new version with the LTE SNR corrected, as well as LTE cell info for Android 4.2 users.. it will probably take an hour or so before it shows up on Google Play. I probably jumped the gun a bit on the LTE cell info since I do not have a 4.2 device to test it on, so hopefully one of you guys can let me know if it crashes or not!

It's crashing on 4.1.1, sent in a report

Link to comment
Share on other sites

I've also been using this app along with Sensorly to map out LTE. The app is MyMobileCoverage in the playstore. th_Screenshot_2013-01-19-10-38-29.png

 

The IDs that app displays are not the LTE sector IDs. They are the CDMA sector IDs, which may be referring to a completely different site. Conflating the CDMA and LTE data like this is a common failing of several such apps. Looks cool, but misinformation.

  • Like 2
Link to comment
Share on other sites

After poking around in the FieldTrial.apk source, I think I've figured out how to get the hex Serving cell ID on the HTC Evo 4G LTE, and probably other LTE phones by HTC:

 

Object mHTCManager;
Method method;
String sectorID;

mHTCManager = getSystemService("htctelephony");
if(mHTCManager) {
 // Workaround fact we don't have a usable HTCTelephonyManager declaration
 method = mHTCManager.getMethod("getSectorID", null);
 sectorID = method.invoke();
}

 

Untested as of yet but I think it should work (modulo my lack of Java-foo).

 

Other potentially interesting methods available seem to include:

 

(some sort of object) requestGetLTERFBandInfo()

(some sort of object) requestGetLTETxRxInfo()

int getLastLTEErrorCode()

Link to comment
Share on other sites

While we're sharing code, here's what I hacked together from the SignalStrengthDetector source on GitHub. It's not great but it should at least allow you to see if your phone (running 4.1 or later) fills in the CellInfo and CellIdentity classes or not.

 

https://github.com/l...rength-Detector

 

Here's the APK (no guarantees, only tested on Nexus 4 and Evo LTE, may do strange things on other devices, don't email me your output, yadda yadda): https://www.dropbox....omeActivity.apk

 

I've been working today on adding some rudimentary support for the hidden LTE APIs on the Evo 4G LTE (and probably other HTC LTE phones on other providers). The top 3 lines in the app should now continuously report the location, signal strength, and LTE cell ID (if available). For phones that populate the official Android API, you should get both the Hex cell ID and the integer physical cell ID (0-503); HTC only exposes the Hex cell ID as far as I can tell, so that's all that I can report.

 

The APK above is updated, and the source is now on Github.

 

Unfortunately I'm not in an LTE area so I haven't had a chance to test the code, but it should work. (I do plan to try it out tomorrow.)

 

What isn't done yet is any logging. I probably need to learn more about background tasks before I can get anything like that to work.

Link to comment
Share on other sites

Hacked some more on it. Found a problem (the getSectorId() call on HTC actually takes a single integer parameter, which is set to 1 by the field test apk - no idea what other values do yet, although I suspect the physical cell ID is available with a different value). It also now creates a logfile on your SD card/emulated SD directory called "ltecells.csv". And there's a notification icon but it doesn't do much yet.

 

APK is here: https://www.dropbox....omeActivity.apk

 

Again, it should also work on devices running Android 4.1 and later that support the official APIs (reportedly some Samsung devices work: Galaxy Nexus and S3), and it probably works on HTC's LTE devices on other carriers too, since I can't imagine HTC would have come up with a different API for those, although only tested on the Evo 4G LTE thus far.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • large.unreadcontent.png.6ef00db54e758d06

  • gallery_1_23_9202.png

  • Posts

    • Fury Gran Coupe (My First Car - What a Boat...)
    • Definite usage quirks in hunting down these sites with a rainbow sim in a s24 ultra. Fell into a hole yesterday so sent off to T-Mobile purgatory. Try my various techniques. No Dish. Get within binocular range of former Sprint colocation and can see Dish equipment. Try to manually set network and everybody but no Dish is listed.  Airplane mode, restart, turn on and off sim, still no Dish. Pull upto 200ft from site straight on with antenna.  Still no Dish. Get to manual network hunting again on phone, power off phone for two minutes. Finally see Dish in manual network selection and choose it. Great signal as expected. I still think the 15 minute rule might work but lack patience. (With Sprint years ago, while roaming on AT&T, the phone would check for Sprint about every fifteen minutes. So at highway speed you could get to about the third Sprint site before roaming would end). Using both cellmapper and signalcheck.net maps to hunt down these sites. Cellmapper response is almost immediate these days (was taking weeks many months ago).  Their idea of where a site can be is often many miles apart. Of course not the same dataset. Also different ideas as how to label a site, but sector details can match with enough data (mimo makes this hard with its many sectors). Dish was using county spacing in a flat suburban area, but is now denser in a hilly richer suburban area.  Likely density of customers makes no difference as a poorer urban area with likely more Dish customers still has country spacing of sites.
    • Mike if you need more Dish data, I have been hunting down sites in western Columbus.  So far just n70 and n71 reporting although I CA all three.
    • Good catch! I meant 115932/119932. Edited my original post I've noticed the same thing lately and have just assumed that they're skipping it now because they're finally able to deploy mmWave small cells.
  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...