Google TelephonyManager類提供了對應的方法
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
int networkType = telephonyManager.getNetworkType();
// 這里對應的值為20 只有依賴為android 10.0才有此屬性
if(networkType ==TelephonyManager.NETWORK_TYPE_NR){
Log.i(TAG,"5G");
}
google官方說明為:
地址為:https://developer.android.com/reference/android/telephony/TelephonyManager
int NETWORK_TYPE_NR
Current network is NR(New Radio) 5G.
NETWORK_TYPE_NR
Added in API level 29
public static final int NETWORK_TYPE_NR
Current network is NR(New Radio) 5G.
Constant Value: 20 (0x00000014)
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/126187.html
標籤:其他
上一篇:助力5G通信建設,由力自動化激光焊錫機在光模塊的應用
下一篇:移動通信中一些術語
