繁体   English   中英

如何使用 xamarin Essential 确定网络类型是 2g、3g 还是 4g

[英]how to determine if network type is 2g, 3g or 4g using xamarin essential

我如何使用 xamarin 确定网络类型是 2g、3g 还是 4g

我知道 xamarin Essential 具有识别连接类型的功能

var current = Connectivity.NetworkAccess;

if (current == NetworkAccess.Internet)
{
     // Connection to internet is available
}

但如果它是互联网类型,那么我想知道它是否是 2g/3g/4g/5g

检查连接插件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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM