I am trying to detect 5G network. I use the telephony manager to get NETWORK_TYPE. Even if I am in 5G network coverage and my phone shows 5G, I do not get NETWORK_TYPE_NR. The NETWORK_TYPE is always 13 i.e. LTE. The Phones Engineering service mode shows NR related data. Is there any way to detect NR (Standalone or Non-Standalone) mode?
I also need to get the Cell Information for NR data. I use telephonyManager.getAllCellinfo(), but I never get an instance of cellinfonr.
Any help is appreciated. Thanks
I faced the same problem for a few weeks ago. In my case, I want to detect 5G network on Galaxy S20-5G but the
getDataNetworkType()
always return 13NETWORK_TYPE_LTE
. Following by netmonster-core strategy, and here is the code that I extract from them to solve my problem.Here is full detector class from netmonster-core: (DetectorLteAdvancedNrServiceState.kt)