TelephonyManager
(资料图)
tm
=
;">TelephonyManager
)
getSystemService
;">Context
.
TELEPHONY_SERVICE
)
;
List
<
CellInfo
>
cellInfoList
=
tm
.
getAllCellInfo
;">)
;
for
;">CellInfo
cellInfo
:
cellInfoList
)
{
if
;">instanceof
CellInfoNr
)
{
CellIdentityNr
cellIdentityNr
=
;">;">CellInfoNr
)
cellInfo
)
.
getCellIdentity
;">)
;
if
;">.
getNrarfcn
;">)
>=
75800
&&
cellIdentityNr
.
getNrarfcn
;">)
<=
80399
)
{
// n28频段被支持
}
}
}
在上面的代码示例中,我们使用TelephonyManager的getAllCellInfo方法来获取当前连接的所有基站信息。然后,我们遍历所有的基站信息,检查每个基站是否属于n28频段。如果基站属于n28频段,则我们可以执行相应的操作。
关键词: