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

    • Since this is kind of the general chat thread, I have to share this humorous story (at least it is to me): Since around February/March of this year, my S22U has been an absolute pain to charge. USB-C cables would immediately fall out and it progressively got worse and worse until it often took me a number of minutes to get the angle of the cable juuuussst right to get charging to occur at all (not exaggerating). The connection was so weak that even walking heavily could cause the cable to disconnect. I tried cleaning out the port with a stable, a paperclip, etc. Some dust/lint/dirt came out but the connection didn't improve one bit. Needless to say, this was a MONSTER headache and had me hating this phone. I just didn't have the finances right now for a replacement.  Which brings us to the night before last. I am angry as hell because I had spent five minutes trying to get this phone to charge and failed. I am looking in the port and I notice it doesn't look right. The walls look rough and, using a staple, the back and walls feel REALLY rough and very hard. I get some lint/dust out with the staple and it improves charging in the sense I can get it to charge but it doesn't remove any of the hard stuff. It's late and it's charging, so that's enough for now. I decide it's time to see if that hard stuff is part of the connector or not. More aggressive methods are needed! I work in a biochem lab and we have a lot of different sizes of disposable needles available. So, yesterday morning, while in the lab I grab a few different sizes of needles between 26AWG and 31 AWG. When I got home, I got to work and start probing the connector with the 26 AWG and 31 AWG needle. The stuff feels extremely hard, almost like it was part of the connector, but a bit does break off. Under examination of the bit, it's almost sandy with dust/lint embedded in it. It's not part of the connector but instead some sort of rock-hard crap! That's when I remember that I had done some rock hounding at the end of last year and in January. This involved lots of digging in very sandy/dusty soils; soils which bare more than a passing resemblance to the crap in the connector. We have our answer, this debris is basically compacted/cemented rock dust. Over time, moisture in the area combined with the compression from inserting the USB-C connector had turned it into cement. I start going nuts chiseling away at it with the 26 AWG needle. After about 5-10 minutes of constant chiseling and scraping with the 26AWG and 31AWG needles, I see the first signs of metal at the back of the connector. So it is metal around the outsides! Another 5 minutes of work and I have scraped away pretty much all of the crap in the connector. A few finishing passes with the 31AWG needle, a blast of compressed air, and it is time to see if this helped any. I plug my regular USB-C cable and holy crap it clicks into place; it hasn't done that since February! I pick up the phone and the cable has actually latched! The connector works pretty much like it did over a year ago, it's almost like having a brand new phone!
    • That's odd, they are usually almost lock step with TMO. I forgot to mention this also includes the September Security Update.
    • 417.55 MB September security update just downloaded here for S24+ unlocked   Edit:  after Sept security update install, checked and found a 13MB GP System update as well.  Still showing August 1st there however. 
    • T-Mobile is selling the rest of the 3.45GHz spectrum to Columbia Capital.  
    • Still nothing for my AT&T and Visible phones.
  • Recently Browsing

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