I need to get PCI of LTE base station. There is a special class and method for it.
我需要获得LTE基站的PCI。它有一个特殊的类和方法。
http://developer.android.com/reference/android/telephony/CellIdentityLte.html
But I'm a novice, and I have no idea how to use info given in developer.android. So, everything I tried is:
但我是新手,我不知道如何使用developer.android中给出的信息。所以,我尝试的一切是:
int i = CellIdentityLte.getPci();
How can I get this value?
我怎样才能得到这个价值?
1 个解决方案
#1
0
register for phonestate listener with this event(PhoneStateListener.LISTEN_CELL_INFO)
使用此事件注册phonestate侦听器(PhoneStateListener.LISTEN_CELL_INFO)
then u will be getting a method namely onCellInfoChanged called .. inside that .. write this code..
那么你将获得一个方法,即onCellInfoChanged,在...里面调用..编写这段代码..
for(Cellinfo m: info)
if (m instanceof CellInfoLte){
CellInfoLte cellInfoLte=(CellInfoLte) m;
cellInfoLte.getCellIdentity().getPci();
Log.d("onCellInfoChanged", "CellInfoLte--" + m);
}
#1
0
register for phonestate listener with this event(PhoneStateListener.LISTEN_CELL_INFO)
使用此事件注册phonestate侦听器(PhoneStateListener.LISTEN_CELL_INFO)
then u will be getting a method namely onCellInfoChanged called .. inside that .. write this code..
那么你将获得一个方法,即onCellInfoChanged,在...里面调用..编写这段代码..
for(Cellinfo m: info)
if (m instanceof CellInfoLte){
CellInfoLte cellInfoLte=(CellInfoLte) m;
cellInfoLte.getCellIdentity().getPci();
Log.d("onCellInfoChanged", "CellInfoLte--" + m);
}