Jump to content

Problems programming Android signal-strength reporting for LTE


boomerbubba

Recommended Posts

Cool. I got an email report from someone with a Samsung S3 where the v17 API doesn't seem to be reporting anything. That may have been a bug at my end; I'd be curious if it works now. I drove around a bit in some LTE areas and was able to fix a few buglets while I was out on the road (rapid application development in the car, always fun).

 

I also added a new feature (which should work on any Jelly Bean CDMA phone): a second log, "esmrcells.csv", now logs your location, SID/NID/BSID, and 1x signal strength when connected to a 224xx SID. Might help people with finding live ESMR cells. I probably can tweak the app a little to actually run OK on ICS too, for people that are interested in doing some ESMR tracking.

Link to comment
Share on other sites

I've hit a bit of a brick wall; apparently on Samsung devices the cell ID and physical cell ID are only available via an internal API that can only be called from the dialer.

 

However, I did figure out how to get the RSRP on most LTE devices, so that should now show up in the app at least. Hopefully when 4.2 hits the Samsung devices they'll implement the official APIs.

 

Edit: The last few releases were refusing to actually stop, and thus eating a lot of battery. If you downloaded in the last 48 hours or so, be sure to update to the latest apk.

Link to comment
Share on other sites

I've hit a bit of a brick wall; apparently on Samsung devices the cell ID and physical cell ID are only available via an internal API that can only be called from the dialer.

 

However, I did figure out how to get the RSRP on most LTE devices, so that should now show up in the app at least. Hopefully when 4.2 hits the Samsung devices they'll implement the official APIs.

 

The latest update does correctly show the LTE RSRP on my GS3. Thanks for all your effort.

 

Question: Is there a dialer code that allows you to see the Cell ID on the GS3? ##debug# will get me to "LTE Enginerring" (at least that's how Samsung spells it), but only the physical cell ID shows up there, and I'm having a hell of a time trying to sort through the values as I try to identify my local LTE cells, as the local offsets don't seem to be exactly 169. My understanding is that the Cell ID shows the cell in the first 5 or 6 hex digits, with the sector value in the last digit or 2. This would be much easier to track than the phys cell ID, but I can't find anywhere that it is reported in the GS3.

  • Like 1
Link to comment
Share on other sites

As far as I've heard, the iPhone 5 is the only device that shows both IDs on its debug screen. Both should be exposed by the CellIdentityLte API in Android 4.2, although that relies on the OEM's radio reporting the data.

Link to comment
Share on other sites

  • 1 month later...

Yesterday I updated my app to include an attempt at getting information from the API 17 functions as well.. if anyone wants to give it a try, the free version is "SignalCheck Lite" on Google Play. You don't need the paid version to see LTE cell info, just a device running Android 4.2 or newer.

 

lordsutch, how are your efforts panning out? I'm still running ICS on my EVO so I've never seen your app (or the LTE cell ID functions of my own app). I want to upgrade, but I prefer the Sense UI and haven't found a Jelly Bean version that doesn't feel like a downgrade.

 

I understand that LTE is the newest widespread cellular technology, but I still find it odd (and a bit frustrating) that this information is so difficult to get our hands on.. although the API 17 code is a big step in the right direction, even if it isn't widely supported yet.

 

-Mike

Link to comment
Share on other sites

For the EVO, getting the Hex Cell ID requires a call to the "HTC Telephony Manager" service. Here's a rough outline:

 

private Object mHTCManager;
/* somewhere in onCreate() */
mHTCManager = getSystemService("htctelephony");
/* when you want to get the cell ID */
String cellID = "";
if(mHTCManager != null) {
Method m = null;
try {
 m = mHTCManager.getClass().getMethod("getSectorId", int.class);
 cellID = (String) m.invoke(mHTCManager, new Object[] {Integer.valueOf(1)} );
} catch (NoSuchMethodException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
} catch (IllegalArgumentException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
} catch (IllegalAccessException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
} catch (InvocationTargetException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
}
}

 

Unlike CellIdentityLte.getCi(), this will give you a String with the hexadecimal cell ID, not an integer. So you will probably want to do use Integer.valueOf(cellID, 16) to convert to an integer (or convert getCi()'s output to hex using String.format or something) in mixed code.

 

Full working code in GitHub at https://github.com/lordsutch/Signal-Strength-Detector/blob/master/src/com/lordsutch/android/signaldetector/SignalDetectorService.java

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

After watching the radio log on my EVO LTE today, it appears the Qualcomm RIL used by AOSP reports the LTE Cell Identity as if it was the UMTS CID, and it reports something else (probably the TAC/tracking area code; looking at pastebins it's too big to be the PCI/physical cell ID, alas) as if it was the UMTS LAC.

 

The bad news is that the internal telephony code in AOSP doesn't report this info via any exposed APIs. The good news is that it shouldn't be hard to hack the reporting into the existing code, although getting it accepted into CM may be a challenge.

Link to comment
Share on other sites

  • 1 year later...

I used to work for Ericsson / Ascom TEMS, devloping TEMS Pocket among other things, and my main problem with the Android cell info API:s is that there is no way to ask for the frequency (ARFCN/UARFCN/EARFCN) of cells.

 

Does anyone know why such an obvious value (to me at least) has been omitted from the API?

Link to comment
Share on other sites

I used to work for Ericsson / Ascom TEMS, devloping TEMS Pocket among other things, and my main problem with the Android cell info API:s is that there is no way to ask for the frequency (ARFCN/UARFCN/EARFCN) of cells.

 

Does anyone know why such an obvious value (to me at least) has been omitted from the API?

As a developer, it drives me nuts as well. Would love to get a standard method to obtain frequency/band information, but it just doesn't exist. There is a suggestion in to have it added, but it's never been addressed. Seems like it should be a simple addition and it would be very useful for the apps a few of us on here have created.

 

-Mike

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...