[英]how to determine if network type is 2g, 3g or 4g using xamarin essential
how can i determine if network type is 2g, 3g or 4g using xamarin essential我如何使用 xamarin 确定网络类型是 2g、3g 还是 4g
I know xamarin essential has functions to identify connectivity type我知道 xamarin Essential 具有识别连接类型的功能
var current = Connectivity.NetworkAccess;
if (current == NetworkAccess.Internet)
{
// Connection to internet is available
}
But if it is internet type then i want to know if it is 2g/3g/4g/5g但如果它是互联网类型,那么我想知道它是否是 2g/3g/4g/5g
Check Connectivity plugin https://github.com/jamesmontemagno/ConnectivityPlugin and ConnectionTypes检查连接插件https://github.com/jamesmontemagno/ConnectivityPlugin和 ConnectionTypes
public enum ConnectionType
{
/// <summary>
/// Cellular connection, 3G, Edge, 4G, LTE
/// </summary>
Cellular,
/// <summary>
/// Wifi connection
/// </summary>
WiFi,
/// <summary>
/// Desktop or ethernet connection
/// </summary>
Desktop,
/// <summary>
/// Wimax (only android)
/// </summary>
Wimax,
/// <summary>
/// Other type of connection
/// </summary>
Other,
/// <summary>
/// Bluetooth connection
/// </summary>
Bluetooth
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.